[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Discard BOM on UTF-{16|32]
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] Discard BOM on UTF-{16|32] |
Date: |
Fri, 23 Sep 2011 21:51:07 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi,
Jeffrey Walton wrote:
> I'm using UTF-16, and I am getting a BOM. Is there a way to suppress
> it?
If you don't want a BOM, then use the encoding name UTF-16LE or UTF-16BE
and transmit that name to the receiver of the converted string. If you
cannot transmit that label "UTF-16LE" or "UTF-16BE" to the receiver, that is,
if the receiver cannot know fore sure whether the string is UTF-16LE or
UTF-16BE, then you MUST transmit a BOM, and the preferred way to do that
is to tell iconv to convert to "UTF-16".
See RFC 2781 for details why this is so.
Bruno
--
In memoriam Ghazala Khan <http://en.wikipedia.org/wiki/Ghazala_Khan>