🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265974

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

#265974
From: Adam H. Kerman
Date: Wed, 12 Apr 2023 15:36
95 lines
5222 bytes
Michael Bauerle  <michael.baeuerle@gmx.net> 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.

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.

If I do a further followup, I have to edit manually AND go back to the
root article to see if I can figure out what the character was intended
to be. If I can, I perform ASCII substitutions.

There's no way to write a parsing mechanism to repair inherited
mistranslated characters getting rid of the bad substitutions.

At least with trn, given that the author is able to edit headers and is
actually expected to add necessary headers, these things can be
repaired. The author using the Apple client has no ability to fix the
mess he created in the composer within the newsreader.

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.

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.

>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. 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.

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

>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!

>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.

>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.

>If the user has configured e.g. US-ASCII to quote an article written in
>Unicode, replacement characters should be inserted if the encoding
>conversion is not possible (instead of simply copying the bytes that are
>then interpreted wrong by the editor and the recipients).

Absolutely, especially ASCII punctuation characters for 8-bit or UTF-8
punctuation characters. Typesetting characters do not belong in plain
text communication.
Technical Details
Message-ID: <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
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>

Show Full Headers
Complete Article Headers
Message-ID: <u16j68$32uql$1@dont-email.me>
Subject: Re: I'm hacking on trn...want to join me?
Date: Wed, 12 Apr 2023 15:36:40 +0000
From: "Adam H. Kerman" <ahk@chinet.com>
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>
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.readers
Organization: A noiseless patient Spider
Cancel-Lock: sha1:3f816bdPsXxjlFQsW2cdbmw6aOE=
Injection-Date: Wed, 12 Apr 2023 15:36:40 -0000 (UTC)
Lines: 95
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)