IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> [X] 0-termination in text frames
patheticpat
post Mar 11 2007, 16:57
Post #1


Member


Group: Members
Posts: 3
Joined: 11-March 07
Member No.: 4573
Mp3tag Version: 2.37h



I discovered the following bug in mp3tag: It appears that mp3tag writes 0-terminated strings in id3v2 text frames where according to the specs there should be no 0-termination. This problem remains mainly unnoticed, but iTunes 7.1 chokes on the extra 0x0 in UTF-8 encoded v2.4 tags.
Go to the top of the page
 
+Quote Post
dano
post Mar 11 2007, 17:07
Post #2


Moderator


Group: Moderators
Posts: 5683
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.63



iTunes itself writes 0-termination on every frame!
And it's no problem for iTunes on other encodings, just utf-8 is a problem for it. Only Apple knows why. It's an iTunes bug!
iTunes also has more ID3v2.4 bugs that can make it problematic to use ID3v2.4 with itunes.


--------------------
Go to the top of the page
 
+Quote Post
patheticpat
post Mar 11 2007, 17:43
Post #3


Member


Group: Members
Posts: 3
Joined: 11-March 07
Member No.: 4573
Mp3tag Version: 2.37h



You are right, iTunes writes the 0-termination, but it doesn't write UTF-8. So, only Apple knows why it does that, but why does Mp3tag do it? I mean, it is still against the specs.
Go to the top of the page
 
+Quote Post
Florian
post Mar 31 2007, 13:44
Post #4


Developer


Group: Admin
Posts: 7710
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.63



I've changed the ID3v2 writer with the current Development Build, so that frames are written without 0-termination.

It wasn't a bug, but it's probably more compatible without the 0-termination.

Kind regards,
Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
klaasklever
post Apr 1 2007, 00:38
Post #5


Member


Group: Full Members
Posts: 62
Joined: 4-October 05
From: Germany
Member No.: 2201
Mp3tag Version: 2.47



So, according to the ID3 specs, is it optional or forbidden
to write terminated text strings ? I was under the impression that
it is optional (i.e. it is not against the specs to do so) ?

And besides, while increasing iTunes "compatibility", are there
any risks that this change might lead to compatibility issues on
other fronts (with other software / other devices) ?

This post has been edited by klaasklever: Apr 1 2007, 00:39
Go to the top of the page
 
+Quote Post
Radagast
post Apr 3 2007, 13:18
Post #6


Member


Group: Members
Posts: 1
Joined: 3-April 07
Member No.: 4703
Mp3tag Version: 2.37



Hello.

According to the specs of Ver. 2.4 there has to be such a termination.

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

Strings dependent on encoding are represented in frame descriptions
as <text string according to encoding>, or <full text string
according to encoding> if newlines are allowed. Any empty strings of
type $01 which are NULL-terminated may have the Unicode BOM followed
by a Unicode NULL ($FF FE 00 00 or $FE FF 00 00).


See also http://www.id3.org/id3v2.4.0-structure .

Regards,
Radagast

This post has been edited by Radagast: Apr 3 2007, 13:19
Go to the top of the page
 
+Quote Post
patheticpat
post Apr 3 2007, 13:36
Post #7


Member


Group: Members
Posts: 3
Joined: 11-March 07
Member No.: 4573
Mp3tag Version: 2.37h



QUOTE (Radagast @ Apr 3 2007, 14:18) *
Hello.

According to the specs of Ver. 2.4 there has to be such a termination.
See also http://www.id3.org/id3v2.4.0-structure .

Regards,
Radagast


Well, the specs isn't very clear regarding the termination. The termination sequences for the different character encodings are relevant for all frames holding several strings, they are separated by the termination sequences (noted as <text string according to encoding> $00 (00) in the specs). But I really don't see any point in terminating single strings. So, I don't know... tongue.gif
Go to the top of the page
 
+Quote Post
klaasklever
post Apr 5 2007, 01:21
Post #8


Member


Group: Full Members
Posts: 62
Joined: 4-October 05
From: Germany
Member No.: 2201
Mp3tag Version: 2.47



Well, I am confused too. From my reading it seems optional, but
the way the spec is written indicates that termination might be the preferred way.

If it is not clear from the specification, I think Mp3tag should do what is common practice
and what most other tag writers do and have done for years. If, for example Winamp, Foobar,
Windows Media Player, and Taglib (Linux) all use termination (I don't know if they do) that
would be what I mean by "common practice".

I think it would not be a good Idea to change the behavior (from termination to no termination)
more or less just because of a bug in iTunes, when it is (I don't know if it is) common practice
to terminate strings. Maybe this would cause problems with some other programs, who knows ?

Anyway, I'm not enough into the specifications and intricacies of ID3v2 to know what's best,
but I just wanted to provide some "food for thought" that maybe it could be not a good idea to
change something that fundamental just because of iTunes...
Go to the top of the page
 
+Quote Post
dano
post Apr 5 2007, 10:40
Post #9


Moderator


Group: Moderators
Posts: 5683
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.63



To me it's pretty clear that this additional termination is wrong, but is also does not do much harm.

The big majority of programs use no termination.
The ID3v2 reference library id3lib doesn't do it.

When you read also the frame definitions of the ID3v2 standard http://www.id3.org/id3v2.4.0-frames and not only the chapter that Radagast showed, you should understand that this chapter only shows how you have to terminate a string but not when.
Compare for example chapter 4.2 with 4.2.6 from id3v2.4.0-frames


--------------------
Go to the top of the page
 
+Quote Post
Florian
post Apr 5 2007, 19:48
Post #10


Developer


Group: Admin
Posts: 7710
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.63



In addition to that, ID3v2.4 uses the terminating 0 to separate multiple strings in one frame. So a terminating 0 after the last string in a text frame could be interpreted as an additional string with zero length. Sounds a little bit hypothetical, but it could be interpreted like that.

Kind regards,
Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
Prodoc
post May 1 2007, 11:31
Post #11


Member


Group: Members
Posts: 4
Joined: 24-October 06
Member No.: 3853
Mp3tag Version: 2.37a



Personally I think the section Radagast referred to is clear enough.

QUOTE
$03 UTF-8 [UTF-8] encoded Unicode [UNICODE]. Terminated with $00.


However, since some still find this disputable, would it be an idea to have the option to enable 0 terminating? Right now I'm tempted to stick to the latest beta which still had 0 termination but this would leave me with possible bugs and the lack of new features like TAK support.
Go to the top of the page
 
+Quote Post
Florian
post May 1 2007, 11:35
Post #12


Developer


Group: Admin
Posts: 7710
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.63



No, this section only refers to strings which need to be terminated (which are referenced as 'terminated string' in the ID3v2.4 spec).

Can you point me to the application which requires the terminating 0 after each string?

Kind regards,
Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
jesus2099
post May 11 2007, 19:30
Post #13


Member


Group: Full Members
Posts: 7
Joined: 11-May 07
From: Paris
Member No.: 4923
Mp3tag Version: 2.38



Hello !!

I have a problem since version 2.38.
My walkman now cuts the last character of my song titles and artist names ! sad.gif
I had a look in the release notes and saw this probable cause :
CODE
[2007-04-29]  REL: VERSION 2.38 (for Windows 2000/XP/2003/Vista)
[2007-03-17]  CHG: ID3v2 text frames are written without terminating 0 now.


Then I found this thread, hopefully !
Previously, my walkman (A-Data MF1), was cutting the last characters of ID3v2.4 (UTF-8) tags only.
When I used ID3v2.3 (UTF-16) tags, it was OK and displayed the full field contents.
Since mp3tag v2.38, the last character is cut, whatever the ID3v2 version…

It would be nice (at least for me) that I would be able to put this "0" back at the end of fields rolleyes.gif
Who cares about iTunes anyway? huh.gif

Tristan

This post has been edited by jesus2099: May 11 2007, 19:55
Go to the top of the page
 
+Quote Post
jesus2099
post Jun 9 2007, 16:13
Post #14


Member


Group: Full Members
Posts: 7
Joined: 11-May 07
From: Paris
Member No.: 4923
Mp3tag Version: 2.38



…so it's a dead end?
Go to the top of the page
 
+Quote Post
Florian
post Jun 9 2007, 21:13
Post #15


Developer


Group: Admin
Posts: 7710
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.63



Yes, I won't change the behaviour again and I don't think that it's good to add options for all this weird software and hardware out there.

Sorry for that!

Kind regards,
Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th August 2014 - 07:13