🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
88 messages
88 total messages Page 2 of 2 Started by Henry Jones Wed, 06 Jul 2016 04:28
Page 2 of 2 • 88 total messages
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260676
Author: Ted S.
Date: Wed, 13 Jul 2016 00:07
14 lines
2290 bytes
On 07/12/2016 11:12 AM, Jernej Simončič wrote:
> On Mon, 11 Jul 2016 19:57:24 -0400, Ted S. wrote:
>
>> >Post in Fraktur.
> 𝔇𝔦𝔡 𝔶𝔬𝔲 𝔨𝔫𝔬𝔴 𝔱𝔥𝔞𝔱 𝔘𝔫𝔦𝔠𝔬𝔡𝔢 𝔥𝔞𝔰 𝔰𝔭𝔢𝔠𝔦𝔣𝔦𝔠
> 𝔠𝔬𝔡𝔢𝔭𝔬𝔦𝔫𝔱𝔰 𝔰𝔢𝔱 𝔞𝔰𝔦𝔡𝔢 𝔣𝔬𝔯 𝔉𝔯𝔞𝔨𝔱𝔲𝔯 (𝖆𝖓𝖉
> 𝖊𝖛𝖊𝖓 𝖇𝖔𝖑𝖉 𝕱𝖗𝖆𝖐𝖙𝖚𝖗)?

Wow.  And it shows up properly on my Linux box, too.  (One of these days 
I'll have to install slrn and see if I can get that running.)

-- 
Ted S.
Catskill Mtns, NY, USA
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260680
Author: tlvp
Date: Wed, 13 Jul 2016 09:17
20 lines
2179 bytes
On Tue, 12 Jul 2016 09:52:38 +0200, Michael Bäuerle wrote:

> tlvp wrote:
>> On Mon, 11 Jul 2016 12:01:47 +0200, Michael Bäuerle wrote:
>>> 
>>> ... form ẞ was invented.
>> 
>> Oops ... that's a glyph Dialog's UTF-8 doesn't recognize. Be so kind, ...
> 
> It's U+1E9E:
> <http://www.fileformat.info/info/unicode/char/1e9e/index.htm>

Thank you kindly. Perhaps someone will be able to tell me whether (and, if
so, how) 40tude Dialog can be coaxed into displaying it correctly? I
already have Dialog set up to use UTF-8 in preference to other encodings,
and Arial Unicode MS as display font for reading posts.

TIA. Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260681
Author: Michael Bäuerle
Date: Wed, 13 Jul 2016 09:20
28 lines
2587 bytes
Jernej Simončič wrote:
> On Tue, 12 Jul 2016 19:05:37 +0200 (CEST), Michael Bäuerle wrote:
> > 
> > 𝔅𝔲𝔱 𝔫𝔬 𝔘𝔪𝔩𝔞𝔲𝔱𝔰 – or have I overlooked them too?
> 
> ℑ'𝔡 𝔱𝔯𝔶 𝔴𝔦𝔱𝔥 𝔠𝔬𝔪𝔟𝔦𝔫𝔦𝔫𝔤 𝔡𝔦𝔞𝔠𝔱𝔯𝔦𝔠𝔰 - 𝔩𝔢̈𝔱'𝔰
> 𝔰𝔢𝔢̈ 𝔴𝔥𝔞̈𝔱 𝔥𝔞𝔭𝔭𝔢̈𝔫𝔰̈.

Pango don't compose the glyphs correctly on my machine.
Below some codepoint sequences that should compose to single glyphs.

Modern a Umlaut in Normal Form D:

   U+0061 (LATIN SMALL LETTER A),
   U+0308 (COMBINING DIAERESIS)
   Test: ä

Same with Fraktur math a symbol:

   U+1D51E (MATHEMATICAL FRAKTUR SMALL A),
   U+0308 (COMBINING DIAERESIS)
   Test: 𝔞̈

For Fraktur the old ligatures with 'e' on top would also be an option:

   U+1D51E (MATHEMATICAL FRAKTUR SMALL A)
   U+0364 (COMBINING LATIN SMALL LETTER E)
   Test: 𝔞ͤ
Re: [Dialog] Unicode capabilities
#260682
Author: tlvp
Date: Wed, 13 Jul 2016 09:29
28 lines
2464 bytes
On Tue, 12 Jul 2016 11:12:59 +0200, Michael Bäuerle wrote:

> tlvp wrote:
>> 
>> [Capital Eszett] 
>> Oops ... that's a glyph Dialog's UTF-8 doesn't recognize.
> 
> In <news:de.test> some time ago Dialog's Unicode capabilities were
> tested. The result was that with UTF-8 it only works for codepoints
> from the BMP. For all codepoints beyond U+FFFF it works with UTF-7:
> <news:4262ed9fb370b5dea2ea5051c904957a@peter.faust-solingen.dialin.t-online.de>
> <news:mqpj8b$3q3$1@tota-refugium.de>
> but fails with UTF-8, producing garbage like surrogate code-points
> (itself it can display what it have produced, but it is not valid
> UTF-8).

Thanks, Michael. I impetuously asked, in a follow-up to the earlier thread,
a question this would be the answer to, before I found this answer here.

Pity that Dialog's no help, then. Anything as good as the

: User-Agent: flnews/0.14pre43 (for NetBSD)

that you're using, but for MS Windows instead? 

Thanks again. -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
Re: [Dialog] Unicode capabilities
#260685
Author: Michael Bäuerle
Date: Wed, 13 Jul 2016 10:10
36 lines
3017 bytes
tlvp wrote:
> On Tue, 12 Jul 2016 11:12:59 +0200, Michael Bäuerle wrote:
> > tlvp wrote:
> > > 
> > > [Capital Eszett] 
> > > Oops ... that's a glyph Dialog's UTF-8 doesn't recognize.
> > 
> > In <news:de.test> some time ago Dialog's Unicode capabilities were
> > tested. The result was that with UTF-8 it only works for codepoints
> > from the BMP. For all codepoints beyond U+FFFF it works with UTF-7:
> > <news:4262ed9fb370b5dea2ea5051c904957a@peter.faust-solingen.dialin.t-online.de>
> > <news:mqpj8b$3q3$1@tota-refugium.de>
> > but fails with UTF-8, producing garbage like surrogate code-points
> > (itself it can display what it have produced, but it is not valid
> > UTF-8).
> 
> Thanks, Michael. I impetuously asked, in a follow-up to the earlier thread,
> a question this would be the answer to, before I found this answer here.
> 
> Pity that Dialog's no help, then. Anything as good as the
> 
> : User-Agent: flnews/0.14pre43 (for NetBSD)
> 
> that you're using, but for MS Windows instead? 

Mozilla Thunderbird has good standard compliance and good display
capabilities.

Many Unix (including X11) newsreaders can run on Windows with Cygwin:
<https://en.wikipedia.org/wiki/Cygwin>
I have read articles that people run slrn and tin this way.
Dennis Preiser has tested flnews on Cygwin some months ago:
<http://d--p.de/tmp/2016-01-07_flnews_cyg-2.png>

But they are all no Dialog replacements (I never used it, but the
Dialog users say so).
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260686
Author: Dave Sparks
Date: Wed, 13 Jul 2016 10:48
16 lines
2125 bytes
On Wed, 13 Jul 2016 05:17:28 -0400, tlvp wrote:

>> It's U+1E9E:
>> <http://www.fileformat.info/info/unicode/char/1e9e/index.htm>
> 
> Thank you kindly. Perhaps someone will be able to tell me whether (and,
> if so, how) 40tude Dialog can be coaxed into displaying it correctly? I
> already have Dialog set up to use UTF-8 in preference to other
> encodings, and Arial Unicode MS as display font for reading posts.

You could try installing the DejaVu typeface (http://dejavu-fonts.org) 
which (in DevaVu Sans Mono Book, at least) includes all the characters 
which have been tried in this thread.


	Dave Sparks
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260689
Author: Adam H. Kerman
Date: Wed, 13 Jul 2016 14:52
23 lines
2402 bytes
tlvp <mPiOsUcB.EtLlLvEp@att.net> wrote:

>Thank you kindly. Perhaps someone will be able to tell me whether (and, if
>so, how) 40tude Dialog can be coaxed into displaying it correctly? I
>already have Dialog set up to use UTF-8 in preference to other encodings,
>and Arial Unicode MS as display font for reading posts.

You're misunderstanding.

Unicode and other character code sets are just that--a set of character
codes to which a specific meaning has been assigned.

The client receives character codes and passes them on to another
process. Now in a graphical display newsreader (as opposed to a character
cell in a terminal), some of those processes are built in.

But your system still has to have fonts available to it. A font is a set
of glyphs to which character codes have been assigned; the same glyph
may be used by more than one character code. A glyph is just the graphic
that represents the desired character.

Not all possible codes have glyphs assigned to them, which is why you
might see ? or a square box as a placeholder for a missing glyph.
Re: Do we really need mime-version, content-type, and content-transfer-encoding headers?
#260694
Author: tlvp
Date: Thu, 14 Jul 2016 05:37
9 lines
1925 bytes
On Wed, 13 Jul 2016 11:48:01 +0100, Dave Sparks wrote:

> You could try installing the DejaVu typeface (http://dejavu-fonts.org) 
> which (in DevaVu Sans Mono Book, at least) includes all the characters 
> which have been tried in this thread.

Thanks, David, I'll follow up on your suggestion. Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
Re: [Dialog] Unicode capabilities
#260695
Author: tlvp
Date: Thu, 14 Jul 2016 05:51
29 lines
2488 bytes
On Wed, 13 Jul 2016 12:10:59 +0200 (CEST), Michael Bäuerle wrote:

> tlvp wrote:
>> 
>> ... Anything as good as the
>> 
>>: User-Agent: flnews/0.14pre43 (for NetBSD)
>> 
>> that you're using, but for MS Windows instead? 
> 
> Mozilla Thunderbird has good standard compliance and good display
> capabilities.
> 
> Many Unix (including X11) newsreaders can run on Windows with Cygwin:
> <https://en.wikipedia.org/wiki/Cygwin>
> I have read articles that people run slrn and tin this way.
> Dennis Preiser has tested flnews on Cygwin some months ago:
> <http://d--p.de/tmp/2016-01-07_flnews_cyg-2.png>
> 
> But they are all no Dialog replacements (I never used it, but the
> Dialog users say so).

Thanks for that, especially your suggestion to run finenews on Windows with
Cygwin. I may have to try that, if using the dejavu fonts (as David Sparks
had suggested) doesn't pan out.

Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
Re: [Dialog] Unicode capabilities
#260696
Author: Michael Bäuerle
Date: Thu, 14 Jul 2016 09:42
83 lines
4948 bytes
tlvp wrote:
> On Wed, 13 Jul 2016 12:10:59 +0200 (CEST), Michael Bäuerle wrote:
> > tlvp wrote:
> > > 
> > > ... Anything as good as the
> > > 
> > > : User-Agent: flnews/0.14pre43 (for NetBSD)
> > > 
> > > that you're using, but for MS Windows instead? 
> > 
> > Mozilla Thunderbird has good standard compliance and good display
> > capabilities.
> > 
> > Many Unix (including X11) newsreaders can run on Windows with Cygwin:
> > <https://en.wikipedia.org/wiki/Cygwin>
> > I have read articles that people run slrn and tin this way.
> > Dennis Preiser has tested flnews on Cygwin some months ago:
> > <http://d--p.de/tmp/2016-01-07_flnews_cyg-2.png>
> > 
> > But they are all no Dialog replacements (I never used it, but the
> > Dialog users say so).
> 
> Thanks for that, especially your suggestion to run finenews on Windows with
> Cygwin. I may have to try that, if using the dejavu fonts (as David Sparks
> had suggested) doesn't pan out.

Notes for DejaVu:

The changelog [1] lists that a glyph for U+1E9E was added to version
2.28 in 2008, but only for Sans and Serif (not Mono that is normally
used for USENET article bodies):

My NetBSD system uses version 2.35:
| 
| # pkg_info | grep DejaVu
| dejavu-ttf-2.35     DejaVu family of TrueType fonts

and is (without glyph substitution) not able to display U+1E9E with
DejaVu Sans Mono.


=======================


Notes for flnews:

1)
Internally flnews supports Unicode in the sense that it can verify the
encoding and apply normalization (currently NFC according to Unicode
9.0). For incoming data UTF-8 and UTF-16BE (UTF-7 technically is Base64
encoded UTF-16BE) transformation formats are supported (failing to
correctly decode UTF-16 transformation format seems to be the reason why
Dialog can't post valid UTF-8 for codepoints beyond the BMP). Converting
ISO 8859 to Unicode is also implemented. This means it is possible to
quote such content correctly even it FLTK is not able to display it (see
below).

2)
To render text, flnews is using the FLTK toolkit. FLTK has different
backends for OSX, X11 and Windows with different capabilities. Glyph
substitution (rendering using mutliple fonts) is currently implemented
only for OSX and AFAIK for Windows too. Example screenshot from Dennis
(Tomato symbol U+1F345 rendered via FLTK's Cocoa backend on OSX):
<http://d--p.de/tmp/2016-07-08_flnews.png>
The official X11 backend of FLTK currently doesn't support glyph
substitution at all. There are patches for doing it internally (via Xft)
from Ian [2] and externally (via Pango) from Manolo [3]. I have used
the Pango patch to display the articles containing Fraktur characters on
NetBSD.

To get similar or better rendering as in Dialog on Windows, this means
that you should not use FLTK's unpatched X11 backend on top of Cygwin
(this is what Dennis has tested in the screenshot formerly quoted).
Instead FLTK should be configured to use the native Windows backend.
This constellation was AFAIK never tested and therefore I can't
guarantee that it will work. But if you nevertheless want to try,
I would be interested in the results.


_____________________
[1] <http://dejavu-fonts.org/wiki/Full_changelog>
[2] <http://www.fltk.org/str.php?L1903>
[3] <http://www.fltk.org/str.php?L3309>
[Fonts] Checking glyph population (was: [Dialog] Unicode capabilities)
#260697
Author: Michael Bäuerle
Date: Thu, 14 Jul 2016 13:46
100 lines
7048 bytes
Michael Bäuerle wrote:
> tlvp wrote:
> > 
> > [...]
> > Thanks for that, especially your suggestion to run finenews on Windows with
> > Cygwin. I may have to try that, if using the dejavu fonts (as David Sparks
> > had suggested) doesn't pan out.
> 
> Notes for DejaVu:
> 
> The changelog [1] lists that a glyph for U+1E9E was added to version
> 2.28 in 2008, but only for Sans and Serif (not Mono that is normally
> used for USENET article bodies):
> 
> My NetBSD system uses version 2.35:
> | 
> | # pkg_info | grep DejaVu
> | dejavu-ttf-2.35     DejaVu family of TrueType fonts
> 
> and is (without glyph substitution) not able to display U+1E9E with
> DejaVu Sans Mono.

Trying to confirm that using fontconfig seems to be a PITA:
| 
| $ fc-list -v 'DejaVu Sans Mono:style=Book' 'charset'
| Pattern has 1 elts (size 16)
|         charset: 
|         0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
|         0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffe00f f371ffcf
|         0002: ffffffff fffffff3 ffff303b ffffffff ffffffff fbffffff 7fcff3c3 000843ff
|         0003: ffffffff ffffffff 01000008 44300002 ffffd7f0 fffffffb ffff7fff ffff0003
|         0004: ffffffff ffffffff ffffffff 000c000c 0fff0000 0c0ffc3c ffff999f 03ffffff
|         0005: 3c030000 fffe0000 fe7fffff fffffffe 000006ff 00000000 00000000 00000000
|         0006: 882016c0 07fffffe 043fffff ce103fff 010200d9 40008210 00001000 03ff0000
|         000e: 00000000 80000000 00000000 00000000 fef02596 1bffecae 00003f00 00000000
|         0010: 00000000 00000000 00000000 00000000 00000000 00000000 ffff0000 1fffffff
|         001d: e0d00304 dfff7000 0fffffff 0980003c f8000020 feffffff 00000000 00000000
|         001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
|         001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
|         0020: ffff07ff f6ff804f 80000be0 fff30000 1fff7fff 033fffff 00000000 00000000
|         0021: 26e0e024 00004c54 fffb0100 00000000 ffff0200 ffffffff ffffffff ffffffff
|         0022: ffafffff 3ff03f89 fffffffe ffffe3ff ffffefff 013c003f fc03e07c 000083ff
|         0023: f33fff7f ffe009e3 ffffffff 27ffffff f8200f0f 00007fff 0000c000 00000000
|         0024: 00000000 00000008 00000000 00000000 00000000 00000000 00000000 00000000
|         0025: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
|         0026: ffffffff ff00ffff ffffffff ffffffff 1fff0fff 00030003 00000000 00000000
|         0027: fffff3de fffffeff 7f47afff 003ffffe ff100000 7ffeffff 10000064 00e00fc1
|         0029: 00000000 00000000 00000000 00000000 01800180 00000000 00000000 0c000800
|         002a: 00000001 00008000 00000000 00000c00 00000000 00000000 00000000 00000000
|         002b: 07fc3fe0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
|         002c: 00000000 00000000 00000000 f6e1e010 00000000 00000000 00000000 00000000
|         002e: 81000000 0000403c 00000000 00000000 00000000 00000000 00000000 00000000
|         00a7: f87fff00 000000fc 00000000 00000000 00037e00 00000400 00000000 03000000
|         00f6: 00000000 00000000 00000000 00000000 00000000 00000000 00000020 00000000
|         00fb: 00000006 00000000 fffc0000 ffffffff c03ffc03 00003c00 00000000 f0000300
|         00fe: 00000000 00000000 00000000 ffdf0000 ffffffff ffffffff ffffffff 9fffffff
|         00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 2e000000
|         01d5: 00000000 00000000 04000000 00000000 00000000 00000000 00000000 00000000
|         01d6: 00000000 00000000 00000000 ffff0000 ffffffff 0000000f 00000000 00000000
|         01d7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffc00000
| (s)

Every line contains bitmaps for 256 glyphs. In the first line C0 and C1
control characters are visible as zeros in blocks 1 and 5 (no glyphs for
obvious reason)
=> The 8 blocks are assigned from left to right.
The zero for the DEL control character in block 4 is on the left
=> The blocks are normal hex numbers with most significant bit left.

This means U+1E9E should be located in the line marked with "001e":
| 
| $ fc-list -v 'DejaVu Sans Mono:style=Book' 'charset' | grep "001e:"
|         001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
                       ^        ^        ^        ^        ^        ^        ^        ^
                    0x00     0x20     0x40     0x60     0x80     0xA0     0xC0     0xE0
                                                    ^^^^^^^^
Index 0x9E should be in the fifth block starting at 0x80.

The bit (for U+1E9E) in this block therefore should be:
| 
| $ printf "%08X\n" $((1 << 0x9E-0x80))
| 40000000

And this bit is zero (no glyph) in the map above:

  8bffffff

Checking again for the proportional sans serif version:
| 
| $ fc-list -v 'DejaVu Sans:style=Book' 'charset' | grep "001e:"
|         001e: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 0fffffff
                                                    ^
Bit is set (glyph present).


Does somebody know an easier option to check for glyph presence in a
font?

> _____________________
> [1] <http://dejavu-fonts.org/wiki/Full_changelog>
Re: [Dialog] Unicode capabilities
#260698
Author: Adam H. Kerman
Date: Thu, 14 Jul 2016 14:07
38 lines
3178 bytes
michael.baeuerle@gmx.net wrote:

>Notes for flnews:

>1)
>Internally flnews supports Unicode in the sense that it can verify the
>encoding and apply normalization (currently NFC according to Unicode
>9.0). For incoming data UTF-8 and UTF-16BE (UTF-7 technically is Base64
>encoded UTF-16BE) transformation formats are supported (failing to
>correctly decode UTF-16 transformation format seems to be the reason why
>Dialog can't post valid UTF-8 for codepoints beyond the BMP). Converting
>ISO 8859 to Unicode is also implemented. This means it is possible to
>quote such content correctly even it FLTK is not able to display it (see
>below).

Can I just point out the obvious? This transformation requires unreasonable
assumptions, relying on precursor articles to have used standard MIME
headers to describe the article bodies. It's possible, hell, common to
post a followup to an article with quotes from multiple authors from
precursor articles in which characters sets WERE NOT transformed into
whatever character set the immediate precursor article claims is in use.

And then, of course, if one of the authors posted through Google Groups,
his article is filled with non-plain-text characters like non-breaking
space which can't be seen by the naked eye unless one does what I have
to do to make them visible to get rid of them, deliberately display text
using a translation that doesn't include the inappropriate character.

Given that one or more persons along the chain of precursor articles
has messed up, the only way for your article to describe the character
set in use in a standard way is to manually delete all the offending
and mismatched characters in the quotes.

Posting a standard followup article can require correcting a lot of past
mistakes, and there's no perfect way of doing that in an automated manner
without eyeballing it.

Let's not kid ourselves.
Re: [Fonts] Checking glyph population
#260699
Author: Bernd Rose
Date: Thu, 14 Jul 2016 14:20
11 lines
2192 bytes
On Thu, 14 Jul 2016 15:46:07 +0200, Michael Bäuerle wrote:

> Does somebody know an easier option to check for glyph presence in a
> font?

Take a look at BabelMap on Windows or Gucharmap on Linux:

www.babelstone.co.uk/Software/BabelMap.html
https://wiki.gnome.org/Apps/Gucharmap

Bernd
Re: [Dialog] Unicode capabilities
#260701
Author: Michael Bäuerle
Date: Thu, 14 Jul 2016 14:55
60 lines
4024 bytes
Adam H. Kerman wrote:
> michael.baeuerle@gmx.net wrote:
>>
>>Internally flnews supports Unicode in the sense that it can verify the
>>encoding and apply normalization (currently NFC according to Unicode
>>9.0). For incoming data UTF-8 and UTF-16BE (UTF-7 technically is Base64
>>encoded UTF-16BE) transformation formats are supported (failing to
>>correctly decode UTF-16 transformation format seems to be the reason why
>>Dialog can't post valid UTF-8 for codepoints beyond the BMP). Converting
>>ISO 8859 to Unicode is also implemented. This means it is possible to
>>quote such content correctly even it FLTK is not able to display it (see
>>below).

>Can I just point out the obvious? This transformation requires unreasonable
>assumptions, relying on precursor articles to have used standard MIME
>headers to describe the article bodies.

Yes. If the character set is not declared, and not the default
(US-ASCII), it can be guessed or the invalid/undefined characters can
be ignored (this is what flnews does) and the user have to repair it by
hand.

But it is not the fault of a newsreader if it has to guess, ignore or
replace something (because the article is not standard compliant).

>It's possible, hell, common to
>post a followup to an article with quotes from multiple authors from
>precursor articles in which characters sets WERE NOT transformed into
>whatever character set the immediate precursor article claims is in use.

In the groups I read it happens rarely (>90% of the articles don't have
such problems).

>And then, of course, if one of the authors posted through Google Groups,
>his article is filled with non-plain-text characters like non-breaking
>space which can't be seen by the naked eye unless one does what I have
>to do to make them visible to get rid of them, deliberately display text
>using a translation that doesn't include the inappropriate character.

In general I have no problems with Google articles. They have some kind
of flowed format with missing line breaks, but Charset-Declaration
is present (and in general correct).

>Given that one or more persons along the chain of precursor articles
>has messed up, the only way for your article to describe the character
>set in use in a standard way is to manually delete all the offending
>and mismatched characters in the quotes.

>Posting a standard followup article can require correcting a lot of past
>mistakes, and there's no perfect way of doing that in an automated manner
>without eyeballing it.

>Let's not kid ourselves.

I fully agree with you. Maybe my statement above was not clear enough:
It belongs to standard compliant articles and if things are declared
correctly, the described operations are working automatically and give
correct results.

Some articles in this thread demonstrate the behaviour.
Re: [Fonts] Checking glyph population
#260708
Author: Michael Bäuerle
Date: Thu, 14 Jul 2016 15:26
19 lines
2499 bytes
Bernd Rose wrote:
> On Thu, 14 Jul 2016 15:46:07 +0200, Michael Bäuerle wrote:
> > 
> > Does somebody know an easier option to check for glyph presence in a
> > font?
> 
> Take a look at BabelMap on Windows or Gucharmap on Linux:
> 
> www.babelstone.co.uk/Software/BabelMap.html
> https://wiki.gnome.org/Apps/Gucharmap

Thanks for the pointers. gucharmap is available for NetBSD too, but it
looks like that it simply uses GTK+ (with its Pango based glyph sub-
stitution) for font rendering:
<http://micha.freeshell.org/tmp/2016-07-14_gucharmap_DejaVu_Sans_Mono.png>
The marked glyph should be missing in the selected font.

I'm searching for an option to check whether a single font contains a
specific glyph or not.
Re: [Dialog] Unicode capabilities
#260709
Author: Adam H. Kerman
Date: Thu, 14 Jul 2016 17:53
71 lines
4659 bytes
Michael michael.baeuerle@gmx.net wrote:
>Adam H. Kerman wrote:
>>michael.baeuerle@gmx.net wrote:

>>>Internally flnews supports Unicode in the sense that it can verify the
>>>encoding and apply normalization (currently NFC according to Unicode
>>>9.0). For incoming data UTF-8 and UTF-16BE (UTF-7 technically is Base64
>>>encoded UTF-16BE) transformation formats are supported (failing to
>>>correctly decode UTF-16 transformation format seems to be the reason why
>>>Dialog can't post valid UTF-8 for codepoints beyond the BMP). Converting
>>>ISO 8859 to Unicode is also implemented. This means it is possible to
>>>quote such content correctly even it FLTK is not able to display it (see
>>>below).

>>Can I just point out the obvious? This transformation requires unreasonable
>>assumptions, relying on precursor articles to have used standard MIME
>>headers to describe the article bodies.

>Yes. If the character set is not declared, and not the default
>(US-ASCII), it can be guessed or the invalid/undefined characters can
>be ignored (this is what flnews does) and the user have to repair it by
>hand.

>But it is not the fault of a newsreader if it has to guess, ignore or
>replace something (because the article is not standard compliant).

I'm not blaming the newsreader. I'm blaming other people who make a lot
of work for everyone else by mismarking their characters sets used and
failing to transform quotes into the currect set. I'm just saying
that the newsreader is over-promising.

>>It's possible, hell, common to
>>post a followup to an article with quotes from multiple authors from
>>precursor articles in which characters sets WERE NOT transformed into
>>whatever character set the immediate precursor article claims is in use.

>In the groups I read it happens rarely (>90% of the articles don't have
>such problems).

You don't get people switching between ISO-8859-1 and UTF-8?

>>And then, of course, if one of the authors posted through Google Groups,
>>his article is filled with non-plain-text characters like non-breaking
>>space which can't be seen by the naked eye unless one does what I have
>>to do to make them visible to get rid of them, deliberately display text
>>using a translation that doesn't include the inappropriate character.

>In general I have no problems with Google articles. They have some kind
>of flowed format with missing line breaks, but Charset-Declaration
>is present (and in general correct).

They're encoded. They're full of non-printing characters that are
used improperly in plain text. It's lots of extra work for me.

>>Given that one or more persons along the chain of precursor articles
>>has messed up, the only way for your article to describe the character
>>set in use in a standard way is to manually delete all the offending
>>and mismatched characters in the quotes.

>>Posting a standard followup article can require correcting a lot of past
>>mistakes, and there's no perfect way of doing that in an automated manner
>>without eyeballing it.

>>Let's not kid ourselves.

>I fully agree with you. Maybe my statement above was not clear enough:
>It belongs to standard compliant articles and if things are declared
>correctly, the described operations are working automatically and give
>correct results.

>Some articles in this thread demonstrate the behaviour.
Re: [Fonts] Checking glyph population
#260710
Author: Bernd Rose
Date: Thu, 14 Jul 2016 20:58
23 lines
2892 bytes
On Thu, 14 Jul 2016 17:26:14 +0200, Michael Bäuerle wrote:

>>> Does somebody know an easier option to check for glyph presence in a
>>> font?
>> 
>> Take a look at BabelMap on Windows or Gucharmap on Linux:
[...]
> Thanks for the pointers. gucharmap is available for NetBSD too, but it
> looks like that it simply uses GTK+ (with its Pango based glyph sub-
> stitution) for font rendering

IMHO, you want this functionality listed in the Gucharmap Wiki:
| See which font is actually being used to draw each character’s glyph

If it is a different one than the "outer part" of a composite font, then
that composite font doesn't contain the glyph.

BabelMap, OTOH, is far more advanced in such matters: You can look at the
fonts in "single font" rather than "composite font" mode, search glyphs
in both ways, identify all fonts supporting single glyphs, all glyphs
from text snippets, selected panes, and so on.

Bernd
Re: [Dialog] Unicode capabilities
#260712
Author: tlvp
Date: Fri, 15 Jul 2016 03:40
17 lines
2116 bytes
On Thu, 14 Jul 2016 11:42:08 +0200, Michael Bäuerle wrote:

> ...
> Notes for DejaVu:
> 
> ... [long detailed commentary omitted to save space] ...
> 
> ... But if you nevertheless want to try,
> I would be interested in the results.

Thanks very much for these specifics. I'll need to study them more
carefully before I'll get much out of them, but once I've absorbed what
they mean for me -- and apply it -- I'll post back.

Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
Re: [Fonts] Checking glyph population
#260719
Author: Michael Bäuerle
Date: Fri, 15 Jul 2016 09:08
29 lines
3033 bytes
Bernd Rose wrote:
> On Thu, 14 Jul 2016 17:26:14 +0200, Michael Bäuerle wrote:
> > 
> > [...]
> > Thanks for the pointers. gucharmap is available for NetBSD too, but it
> > looks like that it simply uses GTK+ (with its Pango based glyph sub-
> > stitution) for font rendering
> 
> IMHO, you want this functionality listed in the Gucharmap Wiki:
> | See which font is actually being used to draw each character’s glyph
> 
> If it is a different one than the "outer part" of a composite font, then
> that composite font doesn't contain the glyph.

This is displayed after right-clicking on a glyph. But there is a better
option: In the Pull-down menu I have overlooked the checkbox:

   "View->Show only glyphs from this font"

After activating it, the glyph for U+1E9E disappears as expected:
<http://micha.freeshell.org/tmp/2016-07-15_gucharmap_DejaVu_Sans_Mono.png>


But the displayed glyphs still don't match the population map displayed
by fontconfig:
| 
| 001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
                                             ^
Example: According to this map U+1E9A should be missing too.
Re: [Dialog] Unicode capabilities
#260721
Author: Michael Bäuerle
Date: Fri, 15 Jul 2016 10:00
35 lines
2818 bytes
Adam H. Kerman wrote:
>Michael michael.baeuerle@gmx.net wrote:
>>Adam H. Kerman wrote:
>>>
>>>[...]
>>>It's possible, hell, common to
>>>post a followup to an article with quotes from multiple authors from
>>>precursor articles in which characters sets WERE NOT transformed into
>>>whatever character set the immediate precursor article claims is in use.

>>In the groups I read it happens rarely (>90% of the articles don't have
>>such problems).

>You don't get people switching between ISO-8859-1 and UTF-8?

Nearly all newsreaders that I see in daily reading can correctly convert
at least between ISO 8859-1, Windows-1252 and UTF-8 in the body.

Some ones (like old Crosspoint) fail to convert from UTF-8 to its
internal representation in the header - but seem to have general
support for RFC2047 and can handle 8-bit character sets. Examples:
<news:DbdpL-UzQoB@allinger-307049.user.uni-berlin>
(reply to ISO 8859-1 encoded subject in article header)
<news:DhmckRPjQoB@allinger-307049.user.uni-berlin>
(reply to UTF-8 encoded subject in article header)
This is one reason why flnews use ISO 8859-1 if possible.

Examples for similar problems in the body with old trn:
<news:nkgg9q$s6f$1@news.albasani.net>
(reply to ISO 8859-1 encoded article body)
<news:nkeruf$p5k$1@news.albasani.net>
(reply to UTF-8 encoded article body)
The (correctly declared) Unicode data was not converted but crippled.
You have already written that this is not the fault of trn itself, but
the result is clearly broken.
Re: [Dialog] Unicode capabilities
#260727
Author: Adam H. Kerman
Date: Fri, 15 Jul 2016 15:26
70 lines
4692 bytes
Michael <michael.baeuerle@gmx.net> wrote:
>Adam H. Kerman wrote:
>>Michael michael.baeuerle@gmx.net wrote:
>>>Adam H. Kerman wrote:

>>>>[...]
>>>>It's possible, hell, common to
>>>>post a followup to an article with quotes from multiple authors from
>>>>precursor articles in which characters sets WERE NOT transformed into
>>>>whatever character set the immediate precursor article claims is in use.

>>>In the groups I read it happens rarely (>90% of the articles don't have
>>>such problems).

>>You don't get people switching between ISO-8859-1 and UTF-8?

>Nearly all newsreaders that I see in daily reading can correctly convert
>at least between ISO 8859-1, Windows-1252 and UTF-8 in the body.

Mere translation is inadequate, and sometimes, that compounds previous
errors. Ideally, if a quote is translated, I'd like the client to bring
to the user's attention problematic characters which might be parsed in
different ways.

If the goal is to communicate with EVERYBODY, then what's required is
obliteration of characters that make a message to Mail or article to
Usenet not plain text. Some of those non-plain-text characters are even
in ISO-8859-1, like nonbreaking space. Too many people posting messages
or articles to a network can't be bothered to think about how much
trouble it is to render their words. "It looks fine on my screen!"

I look for the non-breaking space character. Most people don't. If you
quote one, it's still problematic even though it hasn't caused you any
display difficulty.

>Some ones (like old Crosspoint) fail to convert from UTF-8 to its
>internal representation in the header - but seem to have general
>support for RFC2047 and can handle 8-bit character sets. Examples:
><news:DbdpL-UzQoB@allinger-307049.user.uni-berlin>
>(reply to ISO 8859-1 encoded subject in article header)
><news:DhmckRPjQoB@allinger-307049.user.uni-berlin>
>(reply to UTF-8 encoded subject in article header)
>This is one reason why flnews use ISO 8859-1 if possible.

>Examples for similar problems in the body with old trn:
><news:nkgg9q$s6f$1@news.albasani.net>
>(reply to ISO 8859-1 encoded article body)
><news:nkeruf$p5k$1@news.albasani.net>
>(reply to UTF-8 encoded article body)
>The (correctly declared) Unicode data was not converted but crippled.
>You have already written that this is not the fault of trn itself, but
>the result is clearly broken.

He undoubtably modified the posting script to add the same MIME headers
to his own articles, regardless of the character set used in the quoted
text. If I deliberately quote a non-ASCII character, I'd just write the
necessary MIME header to declare the correct character set.

There are people who have written parsers in order to make reasonable
assumptions about character sets. 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.

trn is from the era in which the user was expected to choose which outside
processes to call, or if necessary, to write his own script or macro. The
text editor itself is an outside process. The translation for the display
is an outside process.
Re: [Fonts] Checking glyph population
#260729
Author: Michael Bäuerle
Date: Fri, 15 Jul 2016 16:56
74 lines
5254 bytes
Michael Bäuerle wrote:
> Bernd Rose wrote:
> > On Thu, 14 Jul 2016 17:26:14 +0200, Michael Bäuerle wrote:
> > > 
> > > [...]
> > > Thanks for the pointers. gucharmap is available for NetBSD too, but it
> > > looks like that it simply uses GTK+ (with its Pango based glyph sub-
> > > stitution) for font rendering
> > 
> > IMHO, you want this functionality listed in the Gucharmap Wiki:
> > | See which font is actually being used to draw each character’s glyph
> > 
> > If it is a different one than the "outer part" of a composite font, then
> > that composite font doesn't contain the glyph.
> 
> This is displayed after right-clicking on a glyph. But there is a better
> option: In the Pull-down menu I have overlooked the checkbox:
> 
>    "View->Show only glyphs from this font"
> 
> After activating it, the glyph for U+1E9E disappears as expected:
> <http://micha.freeshell.org/tmp/2016-07-15_gucharmap_DejaVu_Sans_Mono.png>
> 
> 
> But the displayed glyphs still don't match the population map displayed
> by fontconfig:
> | 
> | 001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
>                                              ^
> Example: According to this map U+1E9A should be missing too.

Summary of my test:
- gucharmap 2.x lacks the option "Show only glyphs from this font"
- gucharmap 3.x have this option in the "View" menu
With this option active the glyph substitution from other fonts is
disabled.
But there is still an engine active that tries to compose missing
glyphs on pixel-level with data from the current font.

Screenshot from gucharmap 2.32.1:
<http://micha.freeshell.org/tmp/2016-07-14_gucharmap_DejaVu_Sans_Mono.png>
Glyph substitution is always active. Look at
U+1E7A (LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS)
character 19 in the 3rd line: Looks good because it is taken from the
Font Courier.

Screenshot from gucharmap 3.8.2:
<http://micha.freeshell.org/tmp/2016-07-15_gucharmap_DejaVu_Sans_Mono.png>
Glyph substitution from other fonts is disabled. The glyph from Courier
for U+1E7A is no longer available - but the field is not empty!
The diaeresis is rendered at the wrong place (not above the main
character) what indicates that the glyph was composed from multiple
parts.

A glyph for U+1E9A (LATIN SMALL LETTER A WITH RIGHT HALF RING) is
displayed, but fontconfig says that DejaVu Sans Mono doesn't have such
a glyph. This seems to be correct, this chart also shows no glyph for
codepoint U+1E9A:
<http://www.fonts2u.com/dejavu-sans-mono-bold.font?charmap=53>

Screenshot from a more recent gucharmap 3.18.2:
<http://micha.freeshell.org/tmp/2016-07-15_gucharmap_GTK3_DejaVu_Sans_Mono.png>
No glyph is displayed for U+1E9A.
Supersede:
Marked glyph U+1E64 (LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE)
and the following 3 glyphs are rendered wrong too. It's no surprise that
fontconfig says "not present" for these 4 glyphs:
| 
| 001e: ff0fffff ffff3fff fff03fff f3ffff0f 8bffffff 33c33003 3f003cc0 033fcf3f
                                         ^


Looks like gucharmap is not a solution for the check "is a glyph for
codepoint x present in font y".
Re: [Fonts] Checking glyph population
#260734
Author: Bernd Rose
Date: Fri, 15 Jul 2016 22:39
15 lines
2789 bytes
On Fri, 15 Jul 2016 18:56:50 +0200, Michael Bäuerle wrote:

> Looks like gucharmap is not a solution for the check "is a glyph for
> codepoint x present in font y".

I was under the impression, that Gucharmap had been getting good enough
for the task, because it had been all along appraised as a good BabelMap
alternative. But after re-checking your tests with the latest version,
Gucharmap still seems too buggy.

Considering, that BabelMap (a stand-alone Windows program) runs well under 
Wine, you should probably give it a go. It has been quasi-standard for
such questions under Windows for at least 15 years and is free to use.

Bernd
Re: [Dialog] Unicode capabilities
#260739
Author: Michael Bäuerle
Date: Sat, 16 Jul 2016 09:56
43 lines
3049 bytes
Adam H. Kerman wrote:
>Michael <michael.baeuerle@gmx.net> wrote:
>>
>>[...]
>>Examples for similar problems in the body with old trn:
>><news:nkgg9q$s6f$1@news.albasani.net>
>>(reply to ISO 8859-1 encoded article body)
>><news:nkeruf$p5k$1@news.albasani.net>
>>(reply to UTF-8 encoded article body)
>>The (correctly declared) Unicode data was not converted but crippled.
>>You have already written that this is not the fault of trn itself, but
>>the result is clearly broken.

>He undoubtably modified the posting script to add the same MIME headers
>to his own articles, regardless of the character set used in the quoted
>text. If I deliberately quote a non-ASCII character, I'd just write the
>necessary MIME header to declare the correct character set.

Simply declaring something without former checking the encoding of
the quoted article is not a good idea.

>There are people who have written parsers in order to make reasonable
>assumptions about character sets.

For the examples above no assumptions are required. All quoted articles
had valid charset declarations.

>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).
Re: [Fonts] Checking glyph population
#260740
Author: Michael Bäuerle
Date: Sat, 16 Jul 2016 12:04
23 lines
3064 bytes
Bernd Rose wrote:
> On Fri, 15 Jul 2016 18:56:50 +0200, Michael Bäuerle wrote:
> > 
> > Looks like gucharmap is not a solution for the check "is a glyph for
> > codepoint x present in font y".
> 
> I was under the impression, that Gucharmap had been getting good enough
> for the task, because it had been all along appraised as a good BabelMap
> alternative. But after re-checking your tests with the latest version,
> Gucharmap still seems too buggy.

For me it doesn't look like a bug. More that the program was written
for a different purpose (searching for special characters, look how GTK+
will render the glyphs for them and then copy&paste the characters to
other applications).

> Considering, that BabelMap (a stand-alone Windows program) runs well under 
> Wine, you should probably give it a go. It has been quasi-standard for
> such questions under Windows for at least 15 years and is free to use.

I will try it, but I use different Unix systems. Some of them have
non-x86 CPUs (like this one) and then at least an additional CPU-
Emulation like qemu will be required for Windows programs.
Re: [Dialog] Unicode capabilities
#260742
Author: Adam H. Kerman
Date: Sat, 16 Jul 2016 15:29
55 lines
3711 bytes
Michael <michael.baeuerle@gmx.net> wrote:
>Adam H. Kerman wrote:
>>Michael <michael.baeuerle@gmx.net> wrote:

>>>[...]
>>>Examples for similar problems in the body with old trn:
>>><news:nkgg9q$s6f$1@news.albasani.net>
>>>(reply to ISO 8859-1 encoded article body)
>>><news:nkeruf$p5k$1@news.albasani.net>
>>>(reply to UTF-8 encoded article body)
>>>The (correctly declared) Unicode data was not converted but crippled.
>>>You have already written that this is not the fault of trn itself, but
>>>the result is clearly broken.

>>He undoubtably modified the posting script to add the same MIME headers
>>to his own articles, regardless of the character set used in the quoted
>>text. If I deliberately quote a non-ASCII character, I'd just write the
>>necessary MIME header to declare the correct character set.

>Simply declaring something without former checking the encoding of
>the quoted article is not a good idea.

That's what my eyes are for.

>>There are people who have written parsers in order to make reasonable
>>assumptions about character sets.

>For the examples above no assumptions are required. All quoted articles
>had valid charset declarations.

I don't assume anything in the case of a quoted quote.

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

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.
Re: [Fonts] Checking glyph population
#260743
Author: Bernd Rose
Date: Sat, 16 Jul 2016 16:14
30 lines
3367 bytes
On Sat, 16 Jul 2016 12:04:31 -0000, Michael Bäuerle wrote:

[Gucharmap showing glyphs, that are not present in the selected font]
> For me it doesn't look like a bug. More that the program was written
> for a different purpose (searching for special characters, look how GTK+
> will render the glyphs for them and then copy&paste the characters to
> other applications).

In composite view mode, that would be expected behavior. In single
font mode ("only glyphs from the selected font"), the "embedded"
glyphs should, IMHO, be omitted.
 
[Testing BabelMap with Wine]
> I will try it, but I use different Unix systems. Some of them have
> non-x86 CPUs (like this one) and then at least an additional CPU-
> Emulation like qemu will be required for Windows programs.

If you know any way to restrict a browser from using fonts in composite
mode, you could also use the minimal BabelMap online version:

  www.babelstone.co.uk/Unicode/babelmap.html

But usually, the mapping is handled on system level. So that wouldn't
probably be an actual option, after all...

Maybe, pyFontaine is better suited for your needs:

  http://pygarden.com/pkg/fontaine

Bernd
Re: [Dialog] Unicode capabilities
#260748
Author: 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.
Re: [Dialog] Unicode capabilities
#260749
Author: Adam H. Kerman
Date: Sun, 17 Jul 2016 15:13
112 lines
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.
Re: [Dialog] Unicode capabilities
#260750
Author: Jernej
Date: Sun, 17 Jul 2016 17:36
33 lines
3057 bytes
On Sun, 17 Jul 2016 15:13:03 +-0000 (UTC), Adam H. Kerman wrote:

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

As long as the character set in the quoted article was declared properly,
the quotes will show up properly - the newsreader might convert the
character set to something else (usually UTF-8), but that doesn't really
matter .

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

I'm not sure how this works on Linux, but clipboard on Windows is always in
Unicode, and it doesn't matter where you copy text from - when it's on
clipboard, it'll be in Unicode, and when you paste it in a modern program,
it'll retain the characters properly (if you have an ancient program that
hasn't been updated to use Unicode, Windows will convert the text to the
locale-defined charset, possibly losing data when pasting, and will convert
the locale-defined charset to Unicode when copying). If you paste such text
to a newsreader, it's then the newsreader's job to ensure proper encoding
is used when posting the article.

-- 
begin  .sig
< Jernej Simon+AQ0-i+AQ0- ><>+Jco-<>< jernej|s-ng at eternallybored.org >
end
Re: [Dialog] Unicode capabilities
#260751
Author: Michael Bäuerle
Date: Sun, 17 Jul 2016 17:56
157 lines
7884 bytes
Adam H. Kerman wrote:
>Michael <michael.baeuerle@gmx.net> wrote:
>>Adam H. Kerman wrote:
>>>
>>>[...]
>>>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 [...]

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

This was the case in the broken, trn produced article I have linked as
example. But according to MIME the whole body has to have the same
encoding.

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

Agreed, copy&paste can be more tricky to handle. But in a follow up,
the quoted content comes from another article and the newsreader can use
its header. For this scenario it should always be clear what character
set the quoted content uses.

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

The "8bit" declaration can be used e.g. by a mail gateway that sends
articles to a moderator via SMTP. If the target protocol can't handle
"8bit", the gateway must convert the article (add a transfer-encoding in
this case).

UTF-7 was invented to avoid this problem for Unicode data, it can be
labeled "7bit" and a gateway can transport it directly via SMTP (neither
conversion nor SMTP extensions are required).

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

If a real transfer encoding like QP is used, this transfer encoding
must be labeled instead of "8bit" in the header. For QP the MIME defined
label is "Quoted-Printable".

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

The data created by the two official MIME transfer encodings QP and
Base64 is always 7bit (this information is implicit for them).

>Plain text should never be encoded on Usenet. Never.

MIME was invented for 2 decades old mail systems. Some of its features
are rarely required for USENET (and I agree, they should not be used if
not required).

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

No. For an article with such fields in the header:

   Content-Transfer-Encoding: 8bit
   Content-Type: text/plain; Charset=UTF-8

they mean "there is *no* transfer encoding used for the body, but it
requires an 8bit capable transport protocol" and "the body uses UTF-8
instead of the default US-ASCII encoding".

If the body uses UTF-7 encoding, the Content-Transfer-Encoding-Field can
be omitted:

   Content-Type: text/plain; Charset=UTF-7

because the default "7bit" is sufficient for transport. There are other
character sets like ISO 2022-JP (for Japanese) that don't require 8bit
transport protocols.

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

Yes.

>trn4 wouldn't check locale environmentvariables natively.

But the text editor of a german user should do. If a script executed
by trn prepares the data in the locales charset, the text editor should
handle it correctly.

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

If the content has wrong MIME declarations or encodings are mixed, I try
to repair the crippled parts manually in the text editor. Things like
crippled Umlauts can be repaired directly from the quoted context.
Otherwise I go back in the article tree and view the original data too.

Some newsreaders, like the Mozilla programs, try hard to guess the
intended meaning of wrong declared or encoded data. And they are good,
in most of the common cases they do the right thing.

flnews do not guess (by intent - if it's broken, I want to see that
it's broken).
Re: [Dialog] Unicode capabilities
#260752
Author: Adam H. Kerman
Date: Sun, 17 Jul 2016 18:34
37 lines
3177 bytes
Jernej Simon+AQ0-i+AQ0-  <jernej|s-ng@eternallybored.org> wrote:
>On Sun, 17 Jul 2016 15:13:03 +-0000 (UTC), Adam H. Kerman wrote:

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

>As long as the character set in the quoted article was declared properly,
>the quotes will show up properly - the newsreader might convert the
>character set to something else (usually UTF-8), but that doesn't really
>matter .

Sigh.

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

>I'm not sure how this works on Linux, but clipboard on Windows is always in
>Unicode, and it doesn't matter where you copy text from - when it's on
>clipboard, it'll be in Unicode, and when you paste it in a modern program,
>it'll retain the characters properly (if you have an ancient program that
>hasn't been updated to use Unicode, Windows will convert the text to the
>locale-defined charset, possibly losing data when pasting, and will convert
>the locale-defined charset to Unicode when copying). If you paste such text
>to a newsreader, it's then the newsreader's job to ensure proper encoding
>is used when posting the article.

If if if if if if if if if if

C'mon, man, don't tell me I don't need to parse for mis-declared characters
sets and inconsistent use of character sets within the article. Do you
read Usenet? Do you see what people do?
Re: [Dialog] Unicode capabilities
#260753
Author: Adam H. Kerman
Date: Sun, 17 Jul 2016 18:48
97 lines
4781 bytes
Michael <michael.baeuerle@gmx.net> wrote:
>Adam H. Kerman wrote:
>>Michael <michael.baeuerle@gmx.net> wrote:
>>>Adam H. Kerman wrote:

>>>>[...]

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

>The "8bit" declaration can be used e.g. by a mail gateway that sends
>articles to a moderator via SMTP. If the target protocol can't handle
>"8bit", the gateway must convert the article (add a transfer-encoding in
>this case).

>UTF-7 was invented to avoid this problem for Unicode data, it can be
>labeled "7bit" and a gateway can transport it directly via SMTP (neither
>conversion nor SMTP extensions are required).

Is this an encoding technique? I'll have to look it up.

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

>If a real transfer encoding like QP is used, this transfer encoding
>must be labeled instead of "8bit" in the header. For QP the MIME defined
>label is "Quoted-Printable".

Ah. I could have sworn I've seen 7bit labeled, together with QP,
always from Google Groups users.

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

>No. For an article with such fields in the header:

>   Content-Transfer-Encoding: 8bit
>   Content-Type: text/plain; Charset=UTF-8

>they mean "there is *no* transfer encoding used for the body, but it
>requires an 8bit capable transport protocol" and "the body uses UTF-8
>instead of the default US-ASCII encoding".

I see. Thanks.

>If the body uses UTF-7 encoding, the Content-Transfer-Encoding-Field can
>be omitted:

>   Content-Type: text/plain; Charset=UTF-7

>because the default "7bit" is sufficient for transport. There are other
>character sets like ISO 2022-JP (for Japanese) that don't require 8bit
>transport protocols.

Thanks.

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

>Yes.

>>trn4 wouldn't check locale environmentvariables natively.

>But the text editor of a german user should do. If a script executed
>by trn prepares the data in the locales charset, the text editor should
>handle it correctly.

Fair enough. As I said, the script he'd modified just added MIME headers;
he wasn't checking.

>flnews do not guess (by intent - if it's broken, I want to see that
>it's broken).

Good.
Re: [Dialog] Unicode capabilities
#260755
Author: Michael Bäuerle
Date: Sun, 17 Jul 2016 20:44
18 lines
1853 bytes
Adam H. Kerman wrote:
>Michael <michael.baeuerle@gmx.net> wrote:
>>
>>UTF-7 was invented to avoid this problem for Unicode data, it can be
>>labeled "7bit" and a gateway can transport it directly via SMTP (neither
>>conversion nor SMTP extensions are required).

>Is this an encoding technique? I'll have to look it up.

Yes, in a double sense. The real Unicode Transformation Format (UTF-16BE
in this case) is packed inside Base64 to get 7bit data.

This resulting data is not human readable, therefore shift sequences are
used to apply the encoding only to the non-ASCII parts of the data (the
shift sequences start with '+' and end with '-' or a line break).

The details are described in RFC2152:
<https://tools.ietf.org/html/rfc2152>
Re: [Dialog] Unicode capabilities
#260754
Author: Adam H. Kerman
Date: Sun, 17 Jul 2016 22:12
14 lines
1800 bytes
Michael <michael.baeuerle@gmx.net> wrote:
>Adam H. Kerman wrote:
>>Michael <michael.baeuerle@gmx.net> wrote:

>>>UTF-7 was invented to avoid this problem for Unicode data, it can be
>>>labeled "7bit" and a gateway can transport it directly via SMTP (neither
>>>conversion nor SMTP extensions are required).

>>Is this an encoding technique? I'll have to look it up.

>Yes, in a double sense. The real Unicode Transformation Format (UTF-16BE
>in this case) is packed inside Base64 to get 7bit data. . . . 

Thanks.
Re: [Fonts] Checking glyph population
#260757
Author: Michael Bäuerle
Date: Mon, 18 Jul 2016 17:06
52 lines
4267 bytes
Bernd Rose wrote:
> On Sat, 16 Jul 2016 12:04:31 -0000, Michael Bäuerle wrote:
> > 
> [Gucharmap showing glyphs, that are not present in the selected font]
> > For me it doesn't look like a bug. More that the program was written
> > for a different purpose (searching for special characters, look how GTK+
> > will render the glyphs for them and then copy&paste the characters to
> > other applications).
> 
> In composite view mode, that would be expected behavior. In single
> font mode ("only glyphs from the selected font"), the "embedded"
> glyphs should, IMHO, be omitted.
>  
> [Testing BabelMap with Wine]
> > I will try it, but I use different Unix systems. Some of them have
> > non-x86 CPUs (like this one) and then at least an additional CPU-
> > Emulation like qemu will be required for Windows programs.
> 
> If you know any way to restrict a browser from using fonts in composite
> mode, you could also use the minimal BabelMap online version:
> 
>   www.babelstone.co.uk/Unicode/babelmap.html
> 
> But usually, the mapping is handled on system level. So that wouldn't
> probably be an actual option, after all...

The test with Wine failed because my NetBSD system is 64bit only, but
the wine package from pkgsrc requires 32bit.

> Maybe, pyFontaine is better suited for your needs:
> 
>   http://pygarden.com/pkg/fontaine

Looks still like overkill. I have found this program:
<https://github.com/repolho/has_char>
Nearly what I want, but checks a string. It's so small that I have now
rewritten it that style myself (10 kByte) to check a single codepoint:
| 
| $ glyphcheck "DejaVu Sans" U+1E9E
| --------------------------------------------------------------------------------
| Selected font    : DejaVu Sans
| Total glyph count: 5888
| Codepoint        : U+1E9E
| --------------------------------------------------------------------------------
| => Glyph present
| $ glyphcheck "DejaVu Sans Mono" U+1E9E
| --------------------------------------------------------------------------------
| Selected font    : DejaVu Sans Mono
| Total glyph count: 3313
| Codepoint        : U+1E9E
| --------------------------------------------------------------------------------
| => No glyph
Re: [Fonts] Checking glyph population
#260758
Author: Bernd Rose
Date: Mon, 18 Jul 2016 18:44
12 lines
2540 bytes
On Mon, 18 Jul 2016 19:06:03 +0200, Michael Bäuerle wrote:

>> Maybe, pyFontaine is better suited for your needs:
[...]
> Looks still like overkill. I have found this program:
> <https://github.com/repolho/has_char>
> Nearly what I want, but checks a string. It's so small that I have now
> rewritten it that style myself (10 kByte) to check a single codepoint

;-)

Bernd
Page 2 of 2 • 88 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads