AW: [ID3 Dev] 0-termination in text frames

Mathias Kunter mathiaskunter at yahoo.de
Sat Mar 17 14:07:04 PDT 2007


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

Yup, I agree. For ID3 2.2 and 2.3 store a null terminated string. For 2.4,
don't write a 0 terminator for the last substring of a text frame since the
0 is defined as separator here. It also wouldn't make much sense the other
way. Look at the following example of a ISO-coded 2.4 text frame:

string1 0x00 string2 0x00 string3 0x00

It simply would be inconsistent to treat the first two 0 bytes as separators
and the last 0 byte as terminator. Therefore, code it as

string1 0x00 string2 0x00 string3

Well, in practice it probably doesn't make much difference. If a 2.4 parser
reads a text frame which contains a final 0x00 byte and there is no
text to follow after it because the frame has been fully decoded now, it would
be nonsense to treat that as "substring of zero length". Who would
ever want to maintain a zero length string!? Therefore, just ignore it from
the decoder point of view.

I think the more important thing to consider is how other programs handle
that and if they can well read the tags. A poorly written parser may
expects to encounter a terminator of the last (or only) substring in a 2.4
frame. If it isn't there, it may skips the frame (although it would be
correctly coded from the specs point of view). Because a zero length
string (when otherwise interpreted as separator) doesn't really matter,
it generally may even be more compatible to although write the last 0x00
terminator to a 2.4 frame (and "violating" the specs).

I don't know a concrete program or parser which behaves that way, but
it would be possible.

Make your choice between
(possible) compatibility improvement <--> (small) violation of the specs.

Best regards.
Mathias







	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

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