• UTF-8 autodetect?

    From Michiel van der Vlist@2:280/5555.1 to Eugene Subbotin on Sat Aug 29 21:14:35 2026
    Hello Eugene,

    For the future: how about UTF-8 autodetect? In the (far) future when UTF-8 becomes the de facto default encoding for Fidonet, we may see UTF-8 encoded message without the CHRS: kludge.

    Detecting if a text is encoded in UTF-8 is relatively simple. Just check if there are no ill formed UTF-8 sequences in the text. I do that in my weekly UTF-8 nodelist report. If you want you can have my code for checking well formed UTF-8 sequences. When I am back home...


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260829
    * Origin: Klein Schnøørd (2:280/5555.1)
  • From Dmitry Protasoff@2:5001/100 to Michiel van der Vlist on Sat Aug 29 20:00:44 2026
    Hello Michiel!

    In a message of 29 Aug 26 21:14, Michiel wrote to Eugene:

    MvdV> For the future: how about UTF-8 autodetect?

    This is already fully implemented in server version of FidoMail. Every message has "announced"/"detected" charset during tossing and final charset is chosen based on several default or user configured rules.

    I had to collect about 20 million historical fidonet messages from the late 90s to write those rules :)


    See you,
    dp.
    --- FidoMail v0.1.3-69-g504ee66
    * Origin: livin' on the edge (2:5001/100)
  • From Dmitry Protasoff@2:5001/100 to Michiel van der Vlist on Sat Aug 29 20:00:44 2026
    Hello Michiel!

    In a message of 29 Aug 26 21:14, Michiel wrote to Eugene:

    MvdV> For the future: how about UTF-8 autodetect?

    This is already fully implemented in server version of FidoMail. Every message has "announced"/"detected" charset during tossing and final charset is chosen based on several default or user configured rules.

    I had to collect about 20 million historical fidonet messages from the late 90s to write those rules :)


    See you,
    dp.
    --- FidoMail v0.1.3-69-g504ee66
    * Origin: livin' on the edge (2:5001/100)
  • From Eugene Subbotin@2:5075/35 to Michiel van der Vlist on Sun Aug 30 03:26:22 2026
    Hello Michiel!

    Saturday August 29 2026 21:14, you wrote to me:

    MvdV> For the future: how about UTF-8 autodetect? In the (far) future when
    MvdV> UTF-8 becomes the de facto default encoding for Fidonet, we may see
    MvdV> UTF-8 encoded message without the CHRS: kludge.

    MvdV> Detecting if a text is encoded in UTF-8 is relatively simple. Just
    MvdV> check if there are no ill formed UTF-8 sequences in the text. I do
    MvdV> that in my weekly UTF-8 nodelist report. If you want you can have my
    MvdV> code for checking well formed UTF-8 sequences. When I am back home...

    Thanks - and yes, please send chkwf8 when you are home (via direct attach). GoldED already has a validator that rejects overlong forms, surrogates and anything above U+10FFFF, and I would like to run it against yours on the edge cases.

    The pieces are all in place, so writing the detection is an afternoon. What I do not want to get wrong is the policy, because once it ships people will have configurations leaning on it.

    It only becomes a question when the text has bytes above 0x7F - pure ASCII is valid UTF-8 and valid in every eight-bit set alike. The rule I would start from is: treat it as UTF-8 only if there is at least one well-formed multi-byte sequence and no ill-formed one. And judge the whole message rather than line by line, both because FTS-5003 says the identifier covers all parts of a message, and because answering a man in the charset he wrote in needs the message to have one.

    Here is the case I keep coming back to. A man writes in CP866 and quotes a paragraph of UTF-8 his editor did not recode. The check fails on his own text, we fall back to the assumed charset, his words read and the quote does not - which is what happens today, so nothing is lost. Now turn it around: he writes in UTF-8 and quotes CP866. The check fails on the few bad bytes in the quote, we read the lot as the assumed eight-bit set, and now his own words are the rubbish while the quote is no better. That is where detection would earn its keep, and the strict rule gives nothing. One bad line poisons the message.

    One way out is to look only at the lines the author typed and skip the quoted ones - the charset of a message is the charset its author wrote in, and a quote is already damaged by whoever sent it. That is not much work, and only mildly circular, in that we would be deciding what is a quote before deciding how to read the bytes.

    So the question for you: have you run into that second case? It bites hardest where the traffic is not ASCII to begin with, so I can go looking in the Russian echoes - what I do not know is how it looks from your side.

    On the future you are aiming at, the precedents are on your side, with one caveat about how such a change arrives. Mail has the same arrangement we do: the charset rides as a parameter on Content-Type, and when it is missing the reader does not guess - plain text is US-ASCII, as it has been for thirty years. That is our rule almost word for word. And it has held even where it is arguably redundant: HTML mandates UTF-8, and a document is still required to say so, on the Content-Type or in a meta tag. The one place the declaration was dropped is JSON, and for your exact reason: once UTF-8 was made the only legal encoding there was nothing left to declare. But each of those was settled on a date, by a body with the standing to settle it. Fidonet will not do that. It will drift, and there will be no day on which a reader may simply start assuming - which is the situation a detector is for.

    Which is also why I would rather put it in now than when it is wanted. This code can go years with nobody in it, and the day UTF-8 without CHRS becomes ordinary is not necessarily a day when anyone is here to add the handling. Better it sits ready and switched off, and the default moves later, when the network has.

    And this is about reading only. What GoldED writes in its own mail is the sysop's business and already his to configure. A keyword, off by default, settable per group.

    Eugene

    ... It's full of stars!
    --- GoldED+/BSD 1.1.5-b20260828 (NetBSD 11.0 Intel Core Haswell)
    * Origin: FireFox Station (2:5075/35)
  • From Michiel van der Vlist@2:280/5555 to Eugene Subbotin on Tue Sep 1 12:55:39 2026
    Hello Eugene,

    On 30 Aug 26 03:26, you wrote to me:

    MvdV>> For the future: how about UTF-8 autodetect? In the (far) future
    MvdV>> when UTF-8 becomes the de facto default encoding for Fidonet,
    MvdV>> we may see UTF-8 encoded message without the CHRS: kludge.

    MvdV>> Detecting if a text is encoded in UTF-8 is relatively simple.
    MvdV>> Just check if there are no ill formed UTF-8 sequences in the
    MvdV>> text. I do that in my weekly UTF-8 nodelist report. If you want
    MvdV>> you can have my code for checking well formed UTF-8 sequences.
    MvdV>> When I am back home...

    Thanks - and yes, please send chkwf8 when you are home (via direct attach). GoldED already has a validator that rejects overlong forms, surrogates and anything above U+10FFFF, and I would like to run it
    against yours on the edge cases.

    Did you find chkwf8 in your inbound?

    The pieces are all in place, so writing the detection is an afternoon.

    Configurable as follows:

    UTFautodetect yes|override|no

    When "yes" it will label a message without a CHRS kludge as UTF-8 and treat it as such when UTF-8 is detected.

    When "override" it will label a message as UTF-8 when UTF-8 is detected even if the CHRS kludge says different.

    When "no" it will disable the autodetect.

    What I do not want to get wrong is the policy, because once it ships people will have configurations leaning on it.

    Hmmm.. I will have to sleep over that. Have patience...


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260830
    * Origin: Nieuw Schnøørd (2:280/5555)
  • From Michiel van der Vlist@2:280/5555.1 to Eugene Subbotin on Tue Sep 1 16:34:30 2026
    Hello Eugene,

    On 30 Aug 26 03:26, you wrote to me:

    The pieces are all in place, so writing the detection is an afternoon. What I do not want to get wrong is the policy, because once it ships people will have configurations leaning on it.

    OK..

    It only becomes a question when the text has bytes above 0x7F - pure
    ASCII is valid UTF-8 and valid in every eight-bit set alike. The rule
    I would start from is: treat it as UTF-8 only if there is at least one well-formed multi-byte sequence and no ill-formed one. And judge the
    whole message rather than line by line, both because FTS-5003 says the identifier covers all parts of a message, and because answering a man
    in the charset he wrote in needs the message to have one.

    So far so good...

    Here is the case I keep coming back to. A man writes in CP866 and
    quotes a paragraph of UTF-8 his editor did not recode. The check fails
    on his own text, we fall back to the assumed charset, his words read
    and the quote does not - which is what happens today, so nothing is
    lost.

    Plus that the reader can always change the coding with control-J so that he/she may still be able to read the quotes.

    Now turn it around: he writes in UTF-8 and quotes CP866. The
    check fails on the few bad bytes in the quote, we read the lot as the assumed eight-bit set, and now his own words are the rubbish while the quote is no better. That is where detection would earn its keep, and
    the strict rule gives nothing. One bad line poisons the message.

    But the reader can still change the coding with control-J...

    One way out is to look only at the lines the author typed and skip the quoted ones - the charset of a message is the charset its author wrote
    in, and a quote is already damaged by whoever sent it. That is not
    much work,

    Yes, I think that woud be a strategy that makes sense.

    and only mildly circular, in that we would be deciding what is a quote before deciding how to read the bytes.

    Golded already has a mechanisme to detect what is a quote, the qoutes are in a different colour.

    So the question for you: have you run into that second case? It bites hardest where the traffic is not ASCII to begin with, so I can go
    looking in the Russian echoes - what I do not know is how it looks
    from your side.

    I haven't seen it yet. I don't read Russian echos, until recently I couldn't even correctly display it and I can't read Russian anyway. It is only in the German and Dutch areas that I read non-ASCII and that is just accents and umlauts, coded in CP850 or Latin-1. I don't recall ever having seen main text and quotes not being in the same encoding, let alone one of them being UTF-8. So I am afraid I am of not much help here. Maybe now that I have an UTF-8 capable reader I may come across it in the future...

    On the future you are aiming at, the precedents are on your side, with
    one caveat about how such a change arrives. Mail has the same
    arrangement we do: the charset rides as a parameter on Content-Type,
    and when it is missing the reader does not guess - plain text is
    US-ASCII, as it has been for thirty years. That is our rule almost
    word for word. And it has held even where it is arguably redundant:
    HTML mandates UTF-8, and a document is still required to say so, on
    the Content-Type or in a meta tag. The one place the declaration was dropped is JSON, and for your exact reason: once UTF-8 was made the
    only legal encoding there was nothing left to declare.

    That was the future I had in mind and was aiming for...

    But each of those was settled on a date, by a body with the standing
    to settle it. Fidonet will not do that.

    Indeed, we having no authoritative body to make such decrees. The FTSC just documents "common practise". Whatever that is, but in any case, after the fact.
    It will drift, and there will be no day on which a reader may simply
    start assuming - which is the situation a detector is for.

    Yep!

    Which is also why I would rather put it in now than when it is wanted. This code can go years with nobody in it, and the day UTF-8 without
    CHRS becomes ordinary is not necessarily a day when anyone is here to
    add the handling. Better it sits ready and switched off, and the
    default moves later, when the network has.

    These were exactly my thougts when I requested MakeNl to be updated to handle non ASCII some two decades ago....

    So go ahead and implement it.

    UTFautodetect Yes|no|override (Default: no)

    Settable globally or per group.

    And this is about reading only. What GoldED writes in its own mail is
    the sysop's business and already his to configure. A keyword, off by default, settable per group.

    Go ahaed!


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260829
    * Origin: Klein Schnøørd (2:280/5555.1)
  • From Michiel van der Vlist@2:280/5555 to Eugene Subbotin on Wed Sep 2 10:12:34 2026
    Hello Eugene,

    01 Sep 26 16:34, I wrote to you:

    So go ahead and implement it.

    UTFautodetect Yes|no|override (Default: no)

    Settable globally or per group.

    And oh, yeah... When XLATIMPORT and UTFautodetect are both specified, autodetect takes precedence when positive.


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260830
    * Origin: Nieuw Schnøørd (2:280/5555)
  • From Michiel van der Vlist@2:280/5555 to Eugene Subbotin on Thu Sep 3 16:36:54 2026
    Hello Eugene,

    02 Sep 26 10:12, I wrote to you:

    UTFautodetect Yes|no|override (Default: no)

    Or perhaps XKATUTFautodetect ...

    Fits better in the XLATxxxx series of keywords


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260830
    * Origin: Nieuw Schnøørd (2:280/5555)
  • From Michiel van der Vlist@2:280/5555 to Eugene Subbotin on Thu Sep 3 16:55:51 2026
    Hello Eugene,

    03 Sep 26 16:36, I wrote to you:


    UTFautodetect Yes|no|override (Default: no)

    Or perhaps XKATUTFautodetect ...

    XLATUTFautodetect


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260830
    * Origin: Nieuw Schnøørd (2:280/5555)
  • From Michiel van der Vlist@2:280/5555 to Eugene Subbotin on Fri Sep 4 12:31:45 2026
    Hello Eugene,

    This is a message I posted here over a decade ago:

    = UTF-8 (2:280/5555) ==========================================================
    Msg : 97 of 1735 Snt Loc
    From : Michiel van der Vlist 2:280/5555 31 Jan 15 12:34:40
    To : All
    Subj : How to enter Unicode characters in Windows =============================================================================== Hello All,

    Most of us know about the Alt num method of entering characters not directly accesible from the keyboard.

    I now found a more general method for directly entering the unicode code point, independent of present code page or language setting.


    Press and hold down the Alt key.
    Press the + (plus) key on the numeric keypad.
    Type the hexidecimal unicode value.
    Release the Alt key.

    To get the Dutch ij ligature on your screen type Alt +0133. ij

    If it does not work, you need to change a setting in the registry:

    Under HKEY_Current_User/Control Panel/Input Method, set EnableHexNumpad to "1". If you have to add it, set the type to be REG_SZ.

    Source:

    http://www.fileformat.info/tip/microsoft/enter_unicode.htm


    Cheers, Michiel

    -+- GoldED+/W32-MINGW 1.1.5-b20110320
    # Origin: http://www.vlist.eu (2:280/5555)

    ==============

    That doesn't work in the unicode version of Golded. Do you think you can make it work? Especially the Alt +hex method?


    Cheers, Michiel

    --- GoldED+/W32-MINGW 1.1.5-b20260830
    * Origin: Nieuw Schnøørd (2:280/5555)