[ID3 Dev] Can text frames be empty

Dale Preston dalepres at msn.com
Mon Feb 12 19:12:00 PST 2007


I thought that the null termination was explicitly excluded except in list
items such as in V2.4 or where specifically identified such as in frames
like APIC and COMM.

I was surprised to find out from Jud last week that the null termination
could optionally be used.

Dale


-----Original Message-----
From: Scott Wheeler [mailto:wheeler at kde.org] 
Sent: Sunday, February 11, 2007 9:39 PM
To: id3v2 at id3.org
Subject: Re: [ID3 Dev] Can text frames be empty

On Sun, 11 Feb 2007 13:28:45 -0600, Dale Preston wrote:
> The description for ID3V2.3 frames says that frames must include at least
> one byte of data.  How does this rule applied to text frames?  For
instance,
> if track number is not set, is a TRCK frame with the frame data as { 0, 0
},
> representing an encoding byte, no string data, and then a null termination
> byte, considered a valid frame?  

It's valid from the perspective of the general frame definition -- 
specifically, for its purposes, everything after the frame header is 
"data" including the encoding byte.

Also note (as this seems to be something that most people haven't 
caught) that null termination of strings is neither required nor 
recommended in the ID3v2 standards.  In ID3v2.3 it simply implies that 
everything following that should be ignored; in 2.4 it is used as the 
separator for a list of values.  Thus a null terminated string in 2.4 
with a strict parser would imply a list of ( "value", "" ).

> If it is valid, is it still better to remove the empty frame?  For
instance,
> if track number is not set, is it better to leave an existing TRCK frame
> with 0,0 for the data or is it better to remove the TRCK frame altogether?

I think that's up to you.  I'd tend to say culling them while parsing 
the tag is the way to go.

Cheers,

-Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
For additional commands, e-mail: id3v2-help at id3.org



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