void String::copyFromUTF16(...) - Comments
festushagenlists at yahoo.com
Wed Jan 22 20:34:08 UTC 2014
Well, I guess I'm really confused because it was/is my understanding that:
On a UTF16 string:
s == 0xfeff == Big Endian regardless of system byte order.
s == 0xfffe == Little Endian regardless of system byte order.
fh : )_~
----- Original Message -----
From: Tsuda Kageyu <tsuda.kageyu at gmail.com>
To: Festus Hagen <festushagenlists at yahoo.com>; taglib-devel at kde.org
Sent: Wednesday, January 22, 2014 2:56 PM
Subject: Re: void String::copyFromUTF16(...) - Comments
>If you read a little-endian BOM as a 16-bit integer in a little-endian
>system, it will be 0xfeff.
>That's what this line checks.
>> if(length >= 1 && s == 0xfeff)
If s == 0xfeff, it means you are reading a UTF-16LE string on a
little-endian system or a UTF-16BE one on a big-endian system. The
comment "Same as CPU endian. No need to swap bytes." describes that
If the UTF-16 endian is different from the CPU endian, a BOM will look
like swapped and s will be 0xfffe.
More information about the taglib-devel