• Mail Server: encoded words in charsets other than UTF-8 (e.g. ISO-8859

    From Rob Swindell@VERT to GitLab issue in main/sbbs on Mon Nov 23 21:48:37 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1415
    2026-11-23 21:48:37 -0800

    When the Mail Server decodes an RFC 2047 encoded word in a received header (To, the From name, CC, Reply-To, Organization, Subject), it converts nothing but UTF-8: the decoded bytes of any other character set are stored as they are, and the message is not flagged as UTF-8 (`MSG_HFIELDS_UTF8`), so the field is then shown as CP437.

    Code references are as of master 093321f948 (hero-4-babies, 2026-11-23).

    ## Example

    ```
    Subject: Re: =?iso-8859-1?q?caf=E9?= is open
    ```

    is stored as `Re: caf` + byte 0xE9 + ` is open`. 0xE9 is e-acute in ISO-8859-1 but a Greek capital theta in CP437, so the Terminal Server shows the subject as "Re: caf(theta) is open". The same applies to Windows-1252, the other ISO-8859 sets, and so on. ISO-8859-1 and Windows-1252 encoded words are still common in mail from older or regional clients.

    ## Where

    `mimehdr_value_decode()` (`src/sbbs3/mailsrvr.cpp:2723`) sets `MSG_HFIELDS_UTF8` only when the charset is `utf-8`, and has a TODO for the rest (line 2756):

    ```c
    // TODO consider converting other 8-bit charsets (e.g. CP437, ISO-8859-1) to UTF-8 here
    ```

    ## Suggested fix

    Convert the decoded text of each encoded word to UTF-8 from its declared charset (at least ISO-8859-1, Windows-1252 and CP437, which need no external library) and flag the message as UTF-8. For a charset it cannot convert, keep the current behavior.

    `exec/load/mimehdr.js` (`to_cp437()`) has the same gap: it converts only `utf-8` encoded words.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net