🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265983

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

#265983
From: Adam H. Kerman
Date: Wed, 12 Apr 2023 18:19
111 lines
5484 bytes
Michael Bauerle  <michael.baeuerle@gmx.net> wrote:
>Adam H. Kerman wrote:
>>Michael Bauerle wrote:
>>>Adam H. Kerman wrote:

>>>>[...]

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

This isn't programming. The best I can do is write macros. Richard was
talking about calling outside processes that already exist, not
requiring the user to write his own parser.

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

No, you need another parsing step after completing the editor to declare
the character set in the MIME header. For instance, if I think I've used
ASCII but there's still an invisible character like nonbreaking space
that's undesireable, I'd want to figure out why the proto article failed
parsing and get rid of the non-plain-text character.

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

The editor isn't the user agent for the purpose of complying with this
standard. trn is noncompliant and it's up to the user to add his own
MIME headers to declare the character set.

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

The editor? No. Use the character set in the terminal emulation,
otherwise you'll introduce yet another point of mismatch.

The trouble is that the terminal emulation needs to switch character
sets on the fly by somehow reading MIME headers and I have no idea how
any of that would happen. It's really really really outside trn.

When I follow up to certain articles, I deliberately create a character
set mismatch as it makes nonbreaking space visible and I can get rid of
that. No one but me would do that.

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

AFTER parsing the output from the composer

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

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

trn just outputs to display. It's up to the display -- in this case, a
terminal emulation or an XTERM-like environment -- to show the article.
Sometimes I have to change the character set the terminal emulation
displays to see the article as intended.

trn doesn't communicate the MIME header to the display. It's up to the
user to make sure there's a character set match between the displayed
article and the terminal emulation.

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

I agree with you here.

>>>. . . 
Technical Details
Message-ID: <u16sn5$o1d$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> <AABkNrMFcqkAAAFo.A3.flnews@WStation5.stz-e.de> <u16j68$32uql$1@dont-email.me> <AABkNuo349EAAAdh.A3.flnews@WStation5.stz-e.de>

Show Full Headers
Complete Article Headers
Message-ID: <u16sn5$o1d$1@dont-email.me>
Subject: Re: I'm hacking on trn...want to join me?
Date: Wed, 12 Apr 2023 18:19:17 +0000
From: "Adam H. Kerman" <ahk@chinet.com>
References: <u0ffth$1u1oi$1@news.xmission.com> <AABkNrMFcqkAAAFo.A3.flnews@WStation5.stz-e.de> <u16j68$32uql$1@dont-email.me> <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
Lines: 111
Newsgroups: news.software.readers
Organization: A noiseless patient Spider
Injection-Date: Wed, 12 Apr 2023 18:19:17 -0000 (UTC)
Cancel-Lock: sha1:jOv398GyGpUAF/lp+BkdqzBf21o=
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)