Article View: news.software.nntp
Article #90290Re: Encoding madness
From: Russ Allbery
Date: Thu, 13 Apr 2023 15:12
Date: Thu, 13 Apr 2023 15:12
51 lines
3892 bytes
3892 bytes
Julien ΓLIE <iulius@nom-de-mon-site.com.invalid> writes:
> My sentence was just about the encoding of the newsgroups file; INN will
> provide its contents as-is when being requested the descriptions. If it
> has multiple unspecified encodings (big5, iso-8859-xx, utf8, cp1252...),
> it will provide them as-is. It won't try to convert them on the fly.
The fundamental protocol problem here is that the LIST NEWSGROUPS command
has no way to convey an encoding, let alone a different encoding for every
line. It's all well and good for different hierarchies to use different
encodings and use appropriate MIME headers for their control messages to
convey that encoding; all of that would in theory work as expected. But,
at the end of that process, a given news server returns the whole thing in
response to LIST NEWSGROUPS, and it has to pick a single encoding for that
response.
It's not even about the storage, really. Yes, right now INN uses a single
big file, but it doesn't need to do that. In theory, it could use some
smarter storage mechanism that preserved the original encoding. But that
doesn't help because of the protocol; it still has to respond to LIST
NEWSGROUPS commands, and at that point the separate encodings don't help.
The only workable choices for a single encoding are ASCII and UTF-8;
everything else is much worse in terms of interoperability. ASCII is not
generally sufficient as soon as one gets too far from western Europe and,
truly, is not really sufficient for western European languages either;
while it may be possible to read French with stripped accent marks or
Spanish without tildes, it's annoying, sometimes ambiguous, and there's no
reason to put up with it in 2023. Hence UTF-8.
Given that, working backwards, sending hierarchy control messages in a
different encoding than UTF-8 (or ASCII, which is a UTF-8 subset) is
probably not the best approach. Even if the news software understands the
MIME headers properly and knows the encoding (which can be dubious), now
the content has to be recoded into UTF-8 by the news server anyway. While
this is a well-defined operation for most encodings, it adds another step
that can fail and another opportunity for something to go wrong.
The best results are likely to come from using UTF-8 end-to-end. This
also has the advantage of being the direction that computing is going
anyway. My understanding is that even Chinese domestic use is
increasingly UTF-8, although support for other encodings is still required
in some situations. (Chinese was a potential sticking point due to issues
with how Chinese, Japanese, and Korean were encoded in Unicode that's more
complex than is worth getting into.)
--
Russ Allbery (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<874jpjx1d5.fsf@hope.eyrie.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<20230411014437.0aef1026@wibble.sysadmininc.com> <1681245447.bystand@zzo38computer.org> <u15pee$1aneb$1@news.trigofacile.com> <u168t2$31asn$1@dont-email.me> <u189ou$1cs7i$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <874jpjx1d5.fsf@hope.eyrie.org> Subject: Re: Encoding madness Date: Thu, 13 Apr 2023 08:12:22 -0700 From: Russ Allbery <eagle@eyrie.org> References: <20230411014437.0aef1026@wibble.sysadmininc.com> <1681245447.bystand@zzo38computer.org> <u15pee$1aneb$1@news.trigofacile.com> <u168t2$31asn$1@dont-email.me> <u189ou$1cs7i$1@news.trigofacile.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: hope.eyrie.org; logging-data="17842"; mail-complaints-to="news@eyrie.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:7SlaBR+5K9IqdHp0Nn+4WvXU26s=