🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #260748

Re: [Dialog] Unicode capabilities

#260748
From: Michael Bäuerle
Date: Sun, 17 Jul 2016 09:47
64 lines
4212 bytes
Adam H. Kerman wrote:
>Michael <michael.baeuerle@gmx.net> wrote:
>>Adam H. Kerman wrote:
>>>
>>>[...]
>>>trn4 could obviously send output of
>>>the proto-article to a parser to allow the user to make a reasonable
>>>choice about what character set to declare, or possibly translate into
>>>the lowest denominator character set or even eradicate non-ASCII characters
>>>that have adequate substitutes in ASCII and to obliterate the
>>>non plain text characters like no-break space.

>>For the examples above an automatic solution for the body could be:
>>Let a parser script extract the charset parameter from the "Content-
>>Type" header field of the quoted article. Then use the extracted value
>>for iconv to convert the quoted data to ISO 8859-1 (the label that is
>>later applied to the result).

>>If iconv fails, because the data cannot be represented as ISO 8859-1,
>>it can still be edited by hand (e.g. replacing Unicode double quotes
>>with chevrons or ASCII double quotes).

>A sanity check is required first before attempting conversion. Was the
>MIME header standard to begin with? I'd never make that assumption.

If an article is not broken, the "Charset" parameter of the
"Content-Type" header field declares the charset for the body (and
only the body, potential 'encoded-words' in the header have their own
character set labels and are independent units).

If the "Content-Transfer-Encoding" header field is missing (which means
the same as "7bit") or declare identity (the values "7bit" or "8bit"),
then the declaration for the charset directly apply to the raw body.
Otherwise (for the values "Quoted-Printable" or "Base64") the declared
transfer-encoding must be decoded first and the declaration of the
charset apply to the result.
Non-identity transfer encoding in the body is normally never used by
real newsreaders, only by mail clients (because SMTP without extensions
is a 7bit protocol).

In other words:
If there is no non-identity transfer encoding declared, the raw body and
the charset declared in the "Content-Type" header field can be used as
input and source character set for iconv.

>Also, you just have to start by assuming that the character set declared
>in the MIME header applies to the new portions of the body and not
>the quoted portions.

In the example article the locale of the user seem to be configured to
use ISO 8859-1 encoding (anything typed into the text editor will get
this encoding).
If the quoted data was converted to ISO 8859-1 (before the editor was
started), the encoding of both parts would have matched.


Looking at this thread, there are some articles that contains characters
that can't be represented with ISO 8859-1. To avoid the situation
"source charset is supported, but conversion to target charset is not
possible" and the situation "user can't type something because the
target charset doesn't support it" flnews always convert the quoted data
to Unicode and the text editor must use UTF-8. The normalization and
conversion to the final character set is done after the editor was
closed.
Technical Details
Message-ID: <AABXi1QnTH4AAEOm.A1.flnews@WStation4.micha.freeshell.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <nli1e8$hi6$1@news.mixmin.net> <AABXiLQ0F8AAAAvc.A1.flnews@WStation5.stz-e.de> <nmavah$p4a$1@news.albasani.net> <AABXigTa+nYAAFHc.A1.flnews@WStation4.micha.freeshell.org> <nmdjs4$lhp$2@news.albasani.net>

Show Full Headers
Complete Article Headers
Message-ID: <AABXi1QnTH4AAEOm.A1.flnews@WStation4.micha.freeshell.org>
Subject: Re: [Dialog] Unicode capabilities
Date: Sun, 17 Jul 2016 09:47:19 -0000
From: Michael Bäuerle <michael.baeuerle@gmx.net>
References: <nli1e8$hi6$1@news.mixmin.net> <AABXiLQ0F8AAAAvc.A1.flnews@WStation5.stz-e.de> <nmavah$p4a$1@news.albasani.net> <AABXigTa+nYAAFHc.A1.flnews@WStation4.micha.freeshell.org> <nmdjs4$lhp$2@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers
Lines: 64
Mime-Version: 1.0
X-Trace: individual.net BuHt77EAGDXZ1PUYavUVhAiILUwworovl9kdDZF4taUoWCstQf
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:D1kd/7goKeoy/HcqhTm5f3odzMA= sha1:YrCSppiIF8Dth/7ZCO73G7YbkjU=
Injection-Date: Sun, 17 Jul 2016 09:47:19 -0000
User-Agent: flnews/0.14pre44 (for AIX)
X-Received-Bytes: 4041
X-Received-Body-CRC: 833290484