🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265981

Re: I'm hacking on trn...want to join me?

#265981
From: Michael Bäuerle
Date: Wed, 12 Apr 2023 17:28
133 lines
6945 bytes
Adam H. Kerman wrote:
> Michael Bäuerle wrote:
> > Adam H. Kerman wrote:
> > > 
> > > [...]
> > > Still, there's just no way to fix up multi-level quotes that used
> > > different character sets mis-translated without the user going back to
> > > the original text to figure out what it was supposed to be and then
> > > translating it consistently with the rest of the text.
> > 
> > If it already happened, this is something that is hard to impossible
> > to repair for some encodings. Most newsreaders don't even try and
> > such a repair algorithm is not what I had in mind.
> > 
> > What I wanted to propose is that trn does not create and send such
> > mixture of encodings and correctly label the encoding used according
> > to MIME (the problem is that trn users produce such broken articles,
> > not that they cannnot read them).
> 
> How is it trn's fault? trn isn't translating anything! It receives
> characters and passes them along to inews -h. It's up to the author to
> recognize the encoding.

Then read my proposal "make it easier for the users to avoid mistakes".

> Take a typical situation I encounter: Root article has non-ASCII
> characters and declares UTF-8. The author of the followup has his
> default character set ISO-8859-1 and has no parsing mechanism. Because
> it's an Apple client, it does weird character substitutions, different
> from what a Windows client might do. Either way, it ignored the declared
> character set of the precursor article.

Then we are back to the case of malformed incoming data.
This is not what I am talking about.

> [...]
> In followup, if the declared character set truly describes the character
> set inherited from the precursor article, at least a decent parser
> called by trn could deal with it, or even translate to another character
> set if necessary and an outside process could add the matching MIME
> header.

This is what I propose. It should be easy for the user to do this.
The code for it should be shipped with the newsreader, not every user
is a programmer too.

> Since I'm a traditionalist, I'd like to have another chance to edit to
> verify that the parser caught everything, and I still want to get rid of
> characters that do not belong in plain text, like nonbreaking space.

I think this would always be the case, because all the automatic
processing should be finished before the editor is launched.

> > It looks like the users don't know what they are doing (not really the
> > fault of trn in this sense) and their editor is not configured for the
> > encoding of the content that is quoted. Maybe it is too inconvenient to
> > change the encoding configuration.
> 
> The editor is an outside process. It's not built into trn. It's not the
> job of the editor to parse, although there seems to be process that
> decodes BASE64 or QP, neither of which belong in Usenet.

No longer true since RFC 5536:
<https://www.rfc-editor.org/rfc/rfc5536#section-2.3>
| 
| User agents MUST meet the definition of MIME conformance in [RFC2049]
| and MUST also support [RFC2231].  This level of MIME conformance
| provides support for internationalization and multimedia in message
| bodies [RFC2045], [RFC2046], and [RFC2231], and support for
| internationalization of header fields [RFC2047] and [RFC2231]. [...]

> That happens
> before the editor sees it. There'd have to be another process before it
> gets to the editor to test that the declared character set of the
> precursor article matches what's actually there.

This part should be added.

Decode transfer encoding first.
Then convert the encoding to match the editor.

Create a MIME declaration for the outgoing data, if not US-ASCII.

> The editor is likely using a character set from an environment variable.

Maybe not generic enough to be used by the newsreader too.

> > I think such mistakes would not occur if trn would automatically convert
> > the content to quote into the encoding used by the editor.
> > The source encoding is declared in the MIME header of the article.
> 
> Snarf
> 
> When it actually matches!

It does not match in the articles I talk about (the user has not
converted the encoding of the incoming data, but has written his reply
with a different encoding). This is the case that should be easier to
avoid.

> > The target encoding should be the one the editor is using (manually
> > configured, if trn cannot automatically detect it).
> 
> Not what trn does. An outside process would have to be called.

Nontrivial outside processes (that are required to correctly process
RFC 5536 conformant articles) should be shipped with the newsreader.

> > The conversion itself can be done with iconv.
> > This would preserve the users choice for the target encoding (would
> > not enforce the usage of Unicode).
> 
> In my opinion, if there are non-ASCII characters but the lowest
> denomination character set is 8-bit, that's the character set to use.
> 
> My opinion is shared with nearly no one.

I share your opinion (as you can see in my articles that use ISO 8859-1,
if possible).

From RFC 2046:
<https://www.rfc-editor.org/rfc/rfc2046#section-4.1.2>
| 
| [...]
| In general, composition software should always use the "lowest common
| denominator" character set possible. [...] More generally,
| if a widely-used character set is a subset of another character set,
| and a body contains only characters in the widely-used subset, it
| should be labelled as being in that subset. [...]

But this text is decades old. If a successor to this RFC would be
written today, it likely would say something like "Always use Unicode
with UTF-8 encoding".
Technical Details
Message-ID: <AABkNuo349EAAAdh.A3.flnews@WStation5.stz-e.de>
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
References: <u0ffth$1u1oi$1@news.xmission.com> <u141o0$28gtp$1@news.xmission.com> <u143j5$2m3va$4@dont-email.me> <AABkNrMFcqkAAAFo.A3.flnews@WStation5.stz-e.de> <u16j68$32uql$1@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <AABkNuo349EAAAdh.A3.flnews@WStation5.stz-e.de>
Subject: Re: I'm hacking on trn...want to join me?
Date: Wed, 12 Apr 2023 17:28:23 +0000
From: Michael Bäuerle <michael.baeuerle@stz-e.de>
References: <u0ffth$1u1oi$1@news.xmission.com> <u141o0$28gtp$1@news.xmission.com> <u143j5$2m3va$4@dont-email.me> <AABkNrMFcqkAAAFo.A3.flnews@WStation5.stz-e.de> <u16j68$32uql$1@dont-email.me>
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
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 Apr 2023 17:28:23 -0000
Mime-Version: 1.0
Newsgroups: news.software.readers
X-Orig-Path: not-for-mail
Lines: 133
X-Trace: individual.net fye154ye78MW07SJodhsbwOcW+6kr/+gL9Dg3y6InPIYR6xFIb
Reply-To: Michael Bäuerle <michael.baeuerle@gmx.net>
Cancel-Lock: sha1:zzUlfPzAdyh1MLqEUZagRCkcs6E= sha256:+zRyEoBSDVlfSYkFhJr193UZkISJy94LyGkr8sIEnc0= sha1:qUIYUc6IuLqsvEIMdPtHoI3cAUc=
User-Agent: flnews/1.2.0pre21 (for NetBSD)