[ID3 Dev] Unicode

Ben Allison benski at winamp.com
Sun Feb 11 21:04:14 PST 2007


And just a note that C compilers treat literal numbers as big endian.

So if you do this
wchar_t BOM = 0xFEFF;
fwrite(&BOM, 1, sizeof(BOM), fp);

it will "do the right thing" regardless of the platform.

similiarly, if you do this:
wchar_t BOM;
fread(&BOM, 1, sizeof(BOM), fp);
if (BOM == 0xFEFF) // don't switch endian
{
}
else // switch endian
{
}

it will also do the right thing, regardless of platform.

> Mark,
>
> This is backwards.  Little endian BOM is FF FE and big endian BOM is FE FF
>
> Mark Smith wrote:
>> 0xFF 0xFE for big-endian, or 0xFE 0xFF for little-endian.
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
For additional commands, e-mail: id3v2-help at id3.org



More information about the ID3v2 mailing list