[ID3 Dev] 0-termination in text frames

Ben Bennett fiji at ayup.limey.net
Sat Mar 17 09:25:56 PDT 2007


On Sat, Mar 17, 2007 at 03:22:56PM +0000, Mathias Kunter wrote:
> well, I think it's clear. Version 2.2 and 2.3 specs say that data
> after a 0x00 byte (or 0x00 0x00 when using UTF16) in text frames
> should be ignored and not displayed. Version 2.4 says a 0 terminator
> separates substrings because every text frame allows multiple
> strings in 2.4.

Yes, but be careful... with some string types the terminator is two
nul bytes not one.

> Well, I don't know if this is a common use-case anyway.

The 2.4 implementations I've seen do not handle multiple substrings
(amarok, itunes).

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

> A good ID3 parser should consider both the frame length and a
> possible existing earlier string terminator anyway when reading the
> tags.

Agreed.  So, I would avoid terminating strings in both 2.3 and 2.4.

	     -ben

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