Fix Unicode property keys in C bindings

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 commit is contained in:
norma
2025-07-03 13:53:31 +02:00
committed by Urs Fleisch
parent 7d86716194
commit e831f0929f
2 changed files with 13 additions and 9 deletions

View File

@ -110,6 +110,7 @@ public:
taglib_property_set(file, "COMPOSER", "Composer 1");
taglib_property_set_append(file, "COMPOSER", "Composer 2");
taglib_property_set(file, "ALBUMARTIST", "Album Artist");
taglib_property_set(file, "COMMENT:\xE2\x80\xBB", "Comment (with description)");
// cppcheck-suppress cstyleCast
TAGLIB_COMPLEX_PROPERTY_PICTURE(props, "JPEG Data", 9, "Written by TagLib",
@ -141,6 +142,7 @@ public:
{"DATE"s, {"2023"s}},
{"COMPOSER"s, {"Composer 1"s, "Composer 2"s}},
{"COMMENT"s, {"Comment"s}},
{"COMMENT:\xE2\x80\xBB"s, {"Comment (with description)"s}},
{"ARTIST"s, {"Artist"s}},
{"ALBUMARTIST"s, {"Album Artist"s}},
{"ALBUM"s, {"Album"s}}