8000 Fix Unicode property keys in C bindings by nta · Pull Request #1281 · taglib/taglib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Unicode property keys in C bindings #1281

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

Merged
merged 1 commit into from
Jul 4, 2025

Conversation

nta
Copy link
Contributor
@nta nta commented Jul 3, 2025

The C bindings would convert a char* to String using the default constructor, which uses the Latin1 encoding, breaking when a key contains a Unicode character (e.g. an ID3v2 comment description).

This was observed failing when trying to read a .mp3 file (crashing using similar code to the C binding test) mostly containing UTF-16 but also with the following comment frame, noting the BOM in the otherwise empty description:

00000000  43 4f 4d 4d 00 00 00 13  00 00 00 65 6e 67 ff fe  |COMM.......eng..|
00000010  00 78 79 7a 78 79 7a 78  79 7a 78 79 7a           |.xyzxyzxyzxyz|

This fix makes these values round-trip correctly between taglib_property_keys and taglib_property_get, and also attempts to fix some other functions that relied on the default constructor.

The C bindings would convert a char* to String using the default
constructor, which uses the Latin1 encoding, breaking when a key
contains a Unicode character (e.g. an ID3v2 comment description).
@nta nta force-pushed the fix/unicode-properties branch from bc2eabf to 0baddcf Compare July 4, 2025 06:31
@ufleisch ufleisch merged commit e831f09 into taglib:master Jul 4, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0