I'm working on decoding MP3 tags using perl and I've got some problems with decoding frames written by fb2k.
Let me illustrate this with an example.
consider a TXXX frame:
Description: MusicBrainz Sortname
Text: All About Eve
This is written by fb2k like this (this is the raw frame as returned by MP3::Tag):
CODE
^A<FF><FE>M^@u^@s^@i^@c^@B^@r^@a^@i^@n^@z^@ ^@S^@o^@r^@t^@n^@a^@m^@e^@^@^@<FF><FE>A^@l^@l^@ ^@A^@b^@o^@u^@t^@ ^@E^@v^@e^@
My problem is with the BOM that is pre-pended to the second null-terminated string.
Here's how I decode the string:
First, strip off and inspect the first char: 0x01 => Unicode.
Next, decode the remaining string as utf-16 using Encode::decode
This produces the following string:
CODE
MusicBrainz Sortname^@\x{feff}All About Eve
Can anyone tell me why fb2k writes the BOM at the start of all (both) strings in the frame and not just at the start of the frame?
Thanks,
R.
