Article View: news.software.readers
Article #260749Re: [Dialog] Unicode capabilities
From: Adam H. Kerman
Date: Sun, 17 Jul 2016 15:13
Date: Sun, 17 Jul 2016 15:13
112 lines
6649 bytes
6649 bytes
Michael <michael.baeuerle@gmx.net> wrote: >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). I'm not discussing the use of encoded words on Subject or From or To. Then we'd have to talk about outrageous abuse of those Web-to-Mail translations (Please SPAM my Web page to all your friends and every mailing list you subscribe to by clicking this link!) that put the page title on Subject as encoded text, even though it's in English! There may be a single non-breaking space or open and close double quote. I'm still discussing whether the character set declaration of the precursor article was correct to begin with. It is my contention that the character set declaration is likely to be correct ONLY for the portions of the body written by the author and not for quoted or re-quoted text. Other people cannot be relied upon to convert correctly or to have quoted correctly. Worse, still, are quotes of copied-n-pasted material from the Web, which almost no one bothers to translate into plain text, let alone convert from the Web page's character set to the one declared in the Usenet article. When copying-n-pasting, the MIME headers are never copied and the paste function makes its own assumption about what set the characters being copied are in. >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. I don't know what the client was suppose to do with the 7bit versus 8bit declaration when reading an article. >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. When QP encoding is used, is it supposed to declare 7bit or 8bit? After all, the purpose of QP encoding is to annoy every Usenet user given that it's 8 bit clean. The encodings are all sequences of 7bit character. Plain text should never be encoded on Usenet. Never. >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. I'm lost here. Are you talking about proprietary Microsoft crap like Winmail.dat format? >>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). Are you talking about your trn4 example? trn4 wouldn't check locale environment variables natively. >If the quoted data was converted to ISO 8859-1 (before the editor was >started), the encoding of both parts would have matched. That's a lot of ifs. As a third party just reading Usenet, it's not safe for me to have made that assumption when posting a followup. >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. What do you do in the not atypical situation in which the character set of the quoted quote isn't obvious due to nontranslation along the way? I have walked back along the article tree to check MIME headers of the author's own article.
Technical Details
Message-ID:
<nmg79v$mik$1@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-mailReferences:
<nli1e8$hi6$1@news.mixmin.net> <AABXigTa+nYAAFHc.A1.flnews@WStation4.micha.freeshell.org> <nmdjs4$lhp$2@news.albasani.net> <AABXi1QnTH4AAEOm.A1.flnews@WStation4.micha.freeshell.org>Show Full Headers
Complete Article Headers
Message-ID: <nmg79v$mik$1@news.albasani.net> Subject: Re: [Dialog] Unicode capabilities Date: Sun, 17 Jul 2016 15:13:03 +0000 From: "Adam H. Kerman" <ahk@chinet.com> References: <nli1e8$hi6$1@news.mixmin.net> <AABXigTa+nYAAFHc.A1.flnews@WStation4.micha.freeshell.org> <nmdjs4$lhp$2@news.albasani.net> <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 Newsgroups: news.software.readers Organization: albasani.net Lines: 112 X-Trace: news.albasani.net jey435D61xCL/39aRpGHBvQMn+s5KLaSenHMk3t4UJGzyzI3MxVrPOM51vGPnq8DTRKezBkaHeH0J7gDLj/PSrEsL7kyKxxUIUGE/XQ8Fpi+vdPzq8BCR6AZHzSNTwox NNTP-Posting-Date: Sun, 17 Jul 2016 15:13:03 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="vvrSaWPLnmjqmPIeSK6y8BSNjFvLxdkHw6xrutb2QEl87TxZBUrwGQrJglQ29WTGPgBv0+E0Cee8hv2b0oD98H10kDRdjPgMUe5+wv4+o9+YK9I0W+r9Fx+Z5NbeZfxi"; mail-complaints-to="abuse@albasani.net" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Cancel-Lock: sha1:dWSMulEaW+iF9BjUchEGa6cZhy0= X-Received-Body-CRC: 4098388718 X-Received-Bytes: 6554