[ID3 Dev] 0-termination in text frames

Paul Taylor paul_t100 at fastmail.fm
Sat Mar 17 12:45:30 PDT 2007


Florian Heidenreich wrote:
> 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
>
>   
I think it is just saying that if you use a null terminated string then 
you should terminate correctly for the encoding you use.
<text string according to encoding> does not include a null terminator, 
where a null terminator is required it is explicity stated in the spec
as these extracts show.

In the first case it states the items should be seperated by a null 
character, so there shouldnt be a null character for the last entry 
because it is not seperating anything.
In the second case a null terminator is always needed to seperate the 
description from the value.


4.2.   Text information frames

   The text information frames are often the most important frames,
   containing information like artist, album and more. There may only be
   one text information frame of its kind in an tag. All text
   information frames supports multiple strings, *stored as a null
   separated list,* *where null is reperesented by the termination code
   for the charater encoding.*


4.2.6.   User defined text information frame
Text encoding     $xx
     Description       <text string according to encoding> *$00 (00)*
     Value             <text string according to encoding>


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