🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #257873

Re: Unicode G clef: 𝄞

#257873
From: Michael Baeuerle
Date: Tue, 10 Jun 2014 09:07
72 lines
4990 bytes
tlvp wrote:
> Michael Baeuerle wrote:
> > Shmuel Metz wrote:
> > > Michael Baeuerle wrote:
> > > > 
> > > > A more precise definition of what "Unicode" means is required here.
> > > 
> > > Sequences of 32-bit codepoints defined by the Unicode consrtium as
> > > valid Unicode.
> > > 
> > > > One thing is not the case:
> > > > Not every codepoint sequence that is valid in UTF-16 representation
> > > > is also a valid codepoint sequence in UTF-8 representation:
> > > 
> > > [...] If you mean
> > > that surrogate pairs in UTF-8 are transforms of Unicode characters
> > > rather than Unicode characters themselves, that's inherent in the
> > > definition of a transform. [...]
> > 
> > I mean that it is not allowed to simply convert the codepoints
> > (UTF-16 surrogate pairs use valid Unicode codepoints) to another UTF
> > in all cases.
> > 
> > Yes, this is inherent to the definition of a transform, but it's widely
> > implemented wrong. Newsreaders like Outlook Express and Dialog cripple
> > replies to correct UTF-8 content containing codepoints above U+FFFF by
> > using UTF-8 encoded surrogate codepoints.
> > 
> > Step 1: Valid UTF
> > Step 2: Valid codepoints
> > Step 3: Normalization
> > 
> > Looks like many programs don't even process to Step 2. I have added
> > U+1D11E (G clef) to the subject. If somebody use Outlook Express or,
> > Dialog please reply for demonstration.
> 
> This reply is coming to you via 40tude Dialog (which evidently failed to
> render any G clef from the outset, so it'd surprise me to find if there
> were a recognizable G clef anywhere in this reply :-) ) .

Result:
| 
| Subject: Re: Unicode G =?utf-8?Q?clef=3A_=ED=A0=B4=ED=B4=9E?=
                                       ^^^^
                                  Colon + Space

The rest of the data are the following two UTF-8 sequences (In a 3-byte
sequence 4 LSBs from the first byte and 6 LSBs from the continuation
bytes respectively are used as payload):

UTF-8       Codepoint
====================================
0xEDA0B4 => U+D834 => High surrogate
0xEDB49E => U+DD1E => Low surrogate

This is a UTF-16 surrogate pair (representing U+1D11E - the G clef - in
UTF-16, and only in UTF-16!):
http://www.fileformat.info/info/unicode/char/1D11E/index.htm
This is exactly the case I had described above. Surrogate codepoints
are invalid for all other transformation formats (including UTF-8).

Looks like Dialog use UTF-16 representation internally (or UCS-2 because
it can't display the surrogate pair). In any case the conversion back
to UTF-8 is invalid. The surrogate pair must be combined to the real
codepoint U+1D11E first and then UTF-8 encoded to 0xF09D849E.

I guess the reason is an old Windows conversion function that can only
handle UCS-2 and not UTF-16 (older versions of Windows had used UCS-2
representation for Unicode internally).


Micha
Technical Details
Message-ID: <AABTlsrZBBwAAAIN.A1.flnews@WStation2.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <AABTdHqgK58AABXP.A1.flnews@WStation2.stz-e.de> <AABTdHwyK6EAABXP.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{2.47.Seattle.2014}> <AABTdJlxK6MAABXP.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{6.10.Seattle.2014}> <AABTdNKdERgAAAiK.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{13.10.Seattle.2014}> <AABTdT6Y83UAAEau.A1.flnews@WStation4.micha.freeshell.org> <537a2a8b$13$fuzhry+tra$mr2ice@news.patriot.net> <AABTejLuQ3kAACG8.A1.flnews@WStation2.stz-e.de> <537a9009$20$fuzhry+tra$mr2ice@news.patriot.net> <AABTfFr7YfEAAAFB.A1.flnews@WStation2.stz-e.de> <537d1bf0$32$fuzhry+tra$mr2ice@news.patriot.net> <AABTfh0HF+UAAAbo.A1.flnews@WStation1.micha.freeshell.org> <537f7304$15$fuzhry+tra$mr2ice@news.patriot.net> <AABTgbui+zwAAAIC.A1.flnews@WStation1.micha.freeshell.org> <538204e6$25$fuzhry+tra$mr2ice@news.patriot.net> <AABTgvX5CpQAAAVK.A1.flnews@WStation2.stz-e.de> <e0wsauyydj4t.ezircgcdijib.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <AABTlsrZBBwAAAIN.A1.flnews@WStation2.stz-e.de>
Subject: Re: Unicode G clef: 𝄞
Date: Tue, 10 Jun 2014 09:07:37 +0000
From: Michael Baeuerle <michael.baeuerle@stz-e.de>
References: <AABTdHqgK58AABXP.A1.flnews@WStation2.stz-e.de> <AABTdHwyK6EAABXP.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{2.47.Seattle.2014}> <AABTdJlxK6MAABXP.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{6.10.Seattle.2014}> <AABTdNKdERgAAAiK.A1.flnews@WStation2.stz-e.de> <Jeff-Relf.Me@May.15{13.10.Seattle.2014}> <AABTdT6Y83UAAEau.A1.flnews@WStation4.micha.freeshell.org> <537a2a8b$13$fuzhry+tra$mr2ice@news.patriot.net> <AABTejLuQ3kAACG8.A1.flnews@WStation2.stz-e.de> <537a9009$20$fuzhry+tra$mr2ice@news.patriot.net> <AABTfFr7YfEAAAFB.A1.flnews@WStation2.stz-e.de> <537d1bf0$32$fuzhry+tra$mr2ice@news.patriot.net> <AABTfh0HF+UAAAbo.A1.flnews@WStation1.micha.freeshell.org> <537f7304$15$fuzhry+tra$mr2ice@news.patriot.net> <AABTgbui+zwAAAIC.A1.flnews@WStation1.micha.freeshell.org> <538204e6$25$fuzhry+tra$mr2ice@news.patriot.net> <AABTgvX5CpQAAAVK.A1.flnews@WStation2.stz-e.de> <e0wsauyydj4t.ezircgcdijib.dlg@40tude.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.20140922.mbox.gz!border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Lines: 72
Reply-To: Michael Baeuerle <michael.baeuerle@gmx.net>
Mime-Version: 1.0
X-Trace: individual.net GfiMgt+6UWnH2s3i2dCp5A21ggcsG+VyLdBtdnaotDt8NInUq0
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:s7j2AhKsRNOqhbmqiUuyPTtesk0=
Injection-Date: 10 Jun 2014 09:07:37 -0000
User-Agent: flnews/0.7 (for NetBSD)
X-Original-Bytes: 4684