IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [X] Trailing nulls in ID3v2 comments
gino0631
post Aug 13 2017, 21:30
Post #1


Member


Group: Members
Posts: 3
Joined: 13-August 17
Member No.: 23766
Mp3tag Version: 2.83h



It looks like the application is incorrectly null-terminating ID3v2 comments; see https://github.com/JamesHeinrich/getID3/issues/121 for details.
Go to the top of the page
 
+Quote Post
ohrenkino
post Aug 14 2017, 06:08
Post #2


Member


Group: Full Members
Posts: 9128
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.84d



see the release notes for V2.81:
http://www.mp3tag.de/en/changelog.html
[2016-12-05] FIX: improved ID3v2 specification compliance by adding terminating 0x00 for text
strings.
So, I would say that this is intentional.


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
gino0631
post Aug 15 2017, 00:10
Post #3


Member


Group: Members
Posts: 3
Joined: 13-August 17
Member No.: 23766
Mp3tag Version: 2.83h



In the specification there are no nulls specified at the end of a comment text, so it is not clear why this change can be considered as an improvement.
Go to the top of the page
 
+Quote Post
Florian
post Aug 15 2017, 07:40
Post #4


Developer


Group: Admin
Posts: 8081
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.84e



OK, let me jump in there.

In the past there were different reports from users that had issues with programs that were expecting all strings terminated with 0x00 (or 0x00 0x00 in case of UTF-16), which led to me changing the way Mp3tag writes strings in ID3v2.

After reading the specification again (not sure how many times I did this), it's clear to me that it makes a implicit differentiation between "text strings" and "terminated text strings". However, at one crucial point in the ID3v2.4 spec §4 it describes the structure of text strings (highlights in bold are added by me):

QUOTE
If nothing else is said, strings, including numeric strings and URLs
[URL], are represented as ISO-8859-1 [ISO-8859-1] characters in the
range $20 - $FF. Such strings are represented in frame descriptions
as <text string>, or <full text string> if newlines are allowed. If
nothing else is said newline character is forbidden. In ISO-8859-1 a
newline is represented, when allowed, with $0A only.

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


This can give the impression that all strings are terminated. In fact, some developers implemented in exactly this way (e.g., Apple iTunes or foobar2000), whereas others are not terminating the strings (e.g., Windows Media Player).

I'd prefer to keep this more compatible implementation. Maybe James could relax his implementation a little?

Kind regards
– Florian


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

Go to the top of the page
 
+Quote Post
gino0631
post Aug 15 2017, 22:18
Post #5


Member


Group: Members
Posts: 3
Joined: 13-August 17
Member No.: 23766
Mp3tag Version: 2.83h



Thank you for the very detailed explanation, I'll inform James.
Go to the top of the page
 
+Quote Post

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: 19th October 2017 - 02:40