emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coding tags and utf-16


From: Kenichi Handa
Subject: Re: coding tags and utf-16
Date: Mon, 06 Mar 2006 22:04:32 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Benjamin Riefenstahl <address@hidden> writes:

> Kenichi Handa writes:
>>> ("\\`\xEF\xBB\xBF" . utf-8)
>> 
>> As far as I know, UTF-8 should not start with this sequence unless
>> the text really starts with ZWNBSP (very unlikely).

> UTF-8 can start with a BOM.  See
> <http://www.unicode.org/faq/utf_bom.html#29>.

That's why I wrote "unless ..." part.  For decoding UTF-8,
we should not delete that BOM but treat it as the content of
the text.  For UTF-16, Unicode explicitly says that "The BOM
is not considered part of the content of the text", but for
UTF-8, it doesn't say such a thing.

Anyway, as Unicode doesn't recommend but doesn't inhibit BOM
in UTF-8 either, if people agree, I'll add it too.

>>> ("\\`\xFE\xFF" . utf-16-be)
>>> ("\\`\xFF\xFE" . utf-16-le)
>> 
>> Although it's not clear how safe they are, if no one objects,
>> I'll add them in auto-coding-regexp-alist.

> Shouldn't those be utf-16-[bl]e-with-signature?  Or has the naming
> convention changed?

Actually utf-16-be is an alias of utf-16be-with-signature
(more precisely, an alias of mule-utf-16be-with-signature)
and is different from utf-16be (and we don't have
utf-16-be-with-signature).  I have a responsibility for this
confusing naming.  I long ago mistakenly accepted and
committed those names (utf-16-[bl]e), and now keeping them
for backward compatibility.  Anyway I agree that using
utf-16[bl]e-with-signature here is better.

---
Kenichi Handa
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]