🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #248071

Re: When is the "\xFeFF" prefix useful ? ( U+FeFF, the BOM/signature )

#248071
From: Pieter Zijlstra
Date: Sun, 08 Jan 2012 00:02
74 lines
4356 bytes
Jeff-Relf.Me wrote:

> Quoting Unicode.ORG, "UTF-8, a transformation format of ISO 10646":
> http://unicode.org/faq/utf_bom.html#bom2
> [snipped]

...and if you read a little further:

<quote>
Q: Can a UTF-8 data stream contain the BOM character (in UTF-8 form)? If yes, then can I still assume the remaining UTF-8 bytes are in big-endian order?

A: Yes, UTF-8 can contain a BOM. However, it makes no difference as to the endianness of the byte stream. UTF-8 always has the same byte order. An initial BOM is only used as a signature — an indication that an otherwise unmarked text file is in UTF-8. Note that some recipients of UTF-8 encoded data do not expect a BOM. Where UTF-8 is used transparently in 8-bit environments, the use of a BOM will interfere with any protocol or file format that expects specific ASCII characters at the beginning, such as the use of "#!" of at the beginning of Unix shell scripts. [AF]

Q: What should I do with U+FEFF in the middle of a file?

A: In the absence of a protocol supporting its use as a BOM and when not at the beginning of a text stream, U+FEFF should normally not occur. For backwards compatibility it should be treated as ZERO WIDTH NON-BREAKING SPACE (ZWNBSP), and is then part of the content of the file or string. The use of U+2060 WORD JOINER is strongly preferred over ZWNBSP for expressing word joining semantics since it cannot be confused with a BOM. When designing a markup language or data protocol, the use of U+FEFF can be restricted to that of Byte Order Mark. In that case, any U+FEFF occurring in the middle of a file can be treated as an unsupported character. [AF] 
</quote>

And the above is just about the general Unicode specification.

We also have to deal with specific RFCs.

> Mail.Yahoo.COM and anything else that orphans the "Suject:" line
> ( e.g. xOver users ) need ( and should use ) the "\xFeFF" prefix,

No, they should use RFC-2047.

> don't just assume it's Windows·1252 or some such crap ! !

Agreed.
  
> People like to read the raw/original headers, either at Google Groups
> or "http://al.howardknight.net/msgid.cgi?MSGI=%3C{mID}%3E".

I can read all original headers, by default including the translated RFC-2047 headers, but if I want I can switch it off and read the raw headers. What I'm trying to say here is that wanting to read all headers does not mean that one has to be bothered with the raw RFC-2047 headers. For debugging purposes one could make an option to see the actual raw headers.

> You asked me:
> « Do you change the subject line each time
>   when you're replying to an email ? »
> 
> Usually, yes.

I was afraid you're going to say that :)

-- 
Pieter

"Incrementing C by 1 is not enough to make a good object-oriented
 language."  -- M. Sakkinen
Technical Details
Message-ID: <xn0hsu8v02p8cmw002Pieter@xs4all.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!fdn.fr!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post2.news.xs4all.nl!newszilla.xs4all.nl!not-for-mail
References: <Jeff-Relf.Me@2012_Jan.3^8.24.pm> <xn0hsq4ub6ysrql00o@newszilla.xs4all.nl> <Jeff-Relf.Me@2012_Jan.5^0.12.am> <xn0hsrk2lco59000Pieter@xs4all.nl> <Jeff-Relf.Me@2012_Jan.5^8.46.pm> <xn0hssymy1fscqf00d@newszilla.xs4all.nl> <Jeff-Relf.Me@2012_Jan.6^9.30.pm>

Show Full Headers
Complete Article Headers
Message-ID: <xn0hsu8v02p8cmw002Pieter@xs4all.nl>
Subject: Re: When is the "\xFeFF" prefix useful ? ( U+FeFF, the BOM/signature )
Date: Sun, 8 Jan 2012 01:02:57 +0100
From: "Pieter Zijlstra" <p.zylstra.notthis@hccnet.nl>
References: <Jeff-Relf.Me@2012_Jan.3^8.24.pm> <xn0hsq4ub6ysrql00o@newszilla.xs4all.nl> <Jeff-Relf.Me@2012_Jan.5^0.12.am> <xn0hsrk2lco59000Pieter@xs4all.nl> <Jeff-Relf.Me@2012_Jan.5^8.46.pm> <xn0hssymy1fscqf00d@newszilla.xs4all.nl> <Jeff-Relf.Me@2012_Jan.6^9.30.pm>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!fdn.fr!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post2.news.xs4all.nl!newszilla.xs4all.nl!not-for-mail
Newsgroups: news.software.readers,alt.free.newsservers
User-Agent: XanaNews (x64; Portable ISpell)/1.19.1.341
X-Ref: newszilla.xs4all.nl ~XNS:00002B88
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Lines: 74
NNTP-Posting-Host: 80.100.173.199
X-Trace: 1325980980 dreader36.news.xs4all.nl 21372 80.100.173.199:21254