Library to read, modify and write ID3 & Lyrics3 tags in MP3 files. Provides an extensible framework for retrieving ID3 information from online services.
There was an error in detecting the correct termination bytes of unicode strings. As result the last character of the string was corrupted and one byte was left in the buffer, thus the following data wasn't decoded correctly (in my example a picture frame for title cover). When the data is written back, the frames are encoded correctly, but with the corrupt data in memory.
Example:
the string "The" in unicode is encoded as follows:
$FF $FE $54 $00 $68 $00 $65 $00 $00 $00
The first two bytes are the byte order marker (BOM)
then, each character is coded with two bytes
and the string is terminated with two zero bytes
The correct begin of the string termination is at index 8 (and not on index 7, where a sequence of zeros begins)
So I implemented the unicode decoding regarding two-byte characters and little-endian or big-endian encoding corresponding to the byte order marker (preamble).
I tryed to simplify the decoding function for better readability and added some comments with the frame specifications for orientation.
also fixed:
implement encoding of lyrics frame (decoding available, but encoding was missing - resulting in an exception)
add correct decode/encode of TXXX frame (description was missing)
There was an error in detecting the correct termination bytes of unicode strings. As result the last character of the string was corrupted and one byte was left in the buffer, thus the following data wasn't decoded correctly (in my example a picture frame for title cover). When the data is written back, the frames are encoded correctly, but with the corrupt data in memory. Example: the string "The" in unicode is encoded as follows: $FF $FE $54 $00 $68 $00 $65 $00 $00 $00
So I implemented the unicode decoding regarding two-byte characters and little-endian or big-endian encoding corresponding to the byte order marker (preamble). I tryed to simplify the decoding function for better readability and added some comments with the frame specifications for orientation.
also fixed: