[Colin Paul Adams] Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

Colin Paul Adams colin at colina.demon.co.uk
Tue Feb 3 12:53:01 EST 2009


>>>>> "John" == John Goerzen <jgoerzen at complete.org> writes:

    >> latin1, utf8, utf16, utf16le, utf16be, utf32, utf32le, utf32be,
    >> localeEncoding,

    John> Will there also be something to handle the UTF-16 BOM
    John> marker?  I'm not sure what the best API for that is, since
    John> it may or may not be present, but it should be considered --
    John> and could perhaps help autodetect encoding.

Not really.

The UTF-16 BOM is only allowed for utf16. Utf16le and utf16be do
not have a BOM.

What it does is alloww you to auto-detect the endianness if utf16 has
been requested as the encoding (if it is not present the big-endian is
assumed).

Ditto for utf32/utf32be/utf32le.
A BOM is thesedays allowed (but deprecated - it should never have been
allowed and originally wasn't) for utf8 also. But it has no value
other than to introduce ambiguity. :-(
-- 
Colin Adams
Preston Lancashire



More information about the Haskell-Cafe mailing list