[erlang-questions] UTF8

Kevin Scaldeferri kevin@REDACTED
Thu Feb 14 16:40:56 CET 2008


On Feb 14, 2008, at 2:42 AM, Hasan Veldstra wrote:

>
>> And how do you suppose my data was turned into UTF-32.  I got the
>> data originally from an HTTP GET request that returned a UTF-8
>> encoded XML file.  The file its self says it's UTF-8, and the
>> header tuple said the document was using the UTF-8 charset.  Does
>> Erlang convert the data automatically?
>
> Actually, 332 (U+14C) is also the UTF-16 encoding for "Ō". If I
> remember correctly, the XML standard requires that the documents be
> in UTF-8 or UTF-16. So it's most likely that your XML file is encoded
> in UTF-16, and the headers are wrong.

The XML standard says that the default encoding is UTF-8, but you can  
specify any encoding you want.

-kevin


More information about the erlang-questions mailing list