-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra 0 at the end of ID3v2 comment #121
Comments
getID3 is returning the comment with a trailing null because that's what the comment contains: Note the encoding is UTF-16 so two bytes for each character. Note the last two bytes of the selected section (the 68 bytes of data for the COMM frame) are 00 00, a UTF-16 encoded null character. I'm not sure what program you used to create those tags, perhaps it's incorrectly null-terminating the comment (the description should be null-terminated, the actual comment should not be). |
Thanks for looking into this. I've used Mp3tag v2.83. |
Let me know if the Mp3tag authors have a different opinion about the issue. |
This post by Florian explains the reasons behind his implementation. |
I'm using the It's frustrating that the relevant specification is written in such a way so as to be ambiguous, thereby causing one developer to implement it differently than another. To quote Florian, from https://community.mp3tag.de/t/x-trailing-nulls-in-id3v2-comments/19227/4 :
Given this most unfortunate state of affairs, what are end-users to do? I'd "complain" to the Mutagen author, but I suspect I'll be met with insistence that the specification is being followed, and that getID3 has it wrong. Curious if your thoughts regarding the specific nature of this debate have changed since your last post in this thread, @JamesHeinrich . Have you read the comment that @gino0631 cited? Are you willing to make the concession put forward therein? Thanks in advance! |
remove null terminator (only if present) #121
I have made change 127aac6 to remove null terminator if present. |
Thanks so much for lightning-fast reply and remediation @JamesHeinrich ! I really appreciate it! Just for the record, and so I understand the specification, is your contention still that the libraries that include the trailing null are in violation of the spec? Or is the spec ambiguous? Thanks again! |
The ID3v2.3 was less ambiguous in this point, but ID3v2.4 spec that Florian quoted makes it less clear. I still think the ID3v2 author's intent was that the comment string not be null-terminated, but since there are multiple variants in the wild I guess it's best to support what's out there, regardless of what the specs intended. For a format that has always had quite extensive documentation, ID3v2 must hold some kind of record for implementations in violation of the specs and/or variant interpretations of said specs. |
Excellent; the clarification is hugely helpful. And somewhat comical. :D One other thought/question: As I describe in quodlibet/mutagen#379 , I notice that the frame values suffer from the same problem. For example, the value at Do these warrant the same "triage"/workaround? |
In 4c2c774 I have extended the remove-trailing-nulls-if-applicable code to all other ID3v2 frame types where I think it's applicable. If I missed something please let me know. |
Perfect! Every instance I had noticed now appears to be fixed, but I'll post an update if I happen upon any others. Thanks again for your prompt replies and willingness to compromise with the other implementations that are in play. |
The fix for JamesHeinrich/getID3#121 is in the master branch only, for the moment.
JamesHeinrich/getID3#121 was merged via JamesHeinrich/getID3#187 , so it is now safe to restore this constraint.
It looks like the library returns extra
0
at the end of ID3v2 comment, which gets converted to�
intags_html
.For example, with this file, containing
COMMENT123456789012345678901
as a comment:The text was updated successfully, but these errors were encountered: