[ID3 Dev] 0-termination in text frames

Florian Heidenreich support at mp3tag.de
Sat Mar 17 12:28:19 PDT 2007


Hello,

Scott Wheeler wrote:
> Ben Bennett wrote:
>> The 2.4 implementations I've seen do not handle multiple substrings
>> (amarok, itunes).
>>   
> 
> TagLib, used by Amarok does, but the Amarok GUI (and in fact the 
> "simple" TagLib API) does not.  They just take the first value.

Mp3tag also does :)


>>> So, if you write a 0 terminator at the end of the string, you
>>> definitely are on the safe side.
>>>     
>>
>> For 2.3 that is certainly true, but I am not so sure in the case of
>> 2.4.  If you have a terminator following the value then doesn't that
>> imply a 0-length item?
>>   
> 
> Yes, I've mentioned that in the past.  It's a subtle distinction, but in 
> 2.4 a null terminated string technically indicates two strings, the 
> second one being empty.

Thanks all for your comments!

I'm still not sure about the issue. The ID3v2.4 spec from 
http://id3.org/id3v2.4.0-structure presents a list of possible encodings 
at '4. ID3v2 frame overview' where the terminating 0 is explicitly 
included in every text string:

<snip>
Frames that allow different types of text encoding contains a text
    encoding description byte. Possible encodings:

      $00   ISO-8859-1 [ISO-8859-1]. Terminated with $00.
      $01   UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM. All
            strings in the same frame SHALL have the same byteorder.
            Terminated with $00 00.
      $02   UTF-16BE [UTF-16] encoded Unicode [UNICODE] without BOM.
            Terminated with $00 00.
      $03   UTF-8 [UTF-8] encoded Unicode [UNICODE]. Terminated with $00.
</snap>

According to that list it seems to me, that every string includes a 
terminating $00 (or $00 00 when using UTF-16).

What do you think about it?

Thank you!

Kind regards,
Florian

---------------------------------------------------------------------
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