Fix UTF16 support for EXIF.UserComment on behalf of floessie
Issue reported here https://discuss.pixls.us/t/call-for-testing-rawtherapee-5-4-rc2/6828/9
This commit is contained in:
@@ -1948,8 +1948,8 @@ void Tag::initUserComment (const Glib::ustring &text)
|
|||||||
memcpy(value, "ASCII\0\0\0", 8);
|
memcpy(value, "ASCII\0\0\0", 8);
|
||||||
memcpy(value + 8, text.c_str(), valuesize - 8);
|
memcpy(value + 8, text.c_str(), valuesize - 8);
|
||||||
} else {
|
} else {
|
||||||
wchar_t *commentStr = (wchar_t*)g_utf8_to_utf16 (text.c_str(), -1, nullptr, nullptr, nullptr);
|
glong wcStrSize = 0;
|
||||||
size_t wcStrSize = wcslen(commentStr);
|
gunichar2 *commentStr = g_utf8_to_utf16 (text.c_str(), -1, nullptr, &wcStrSize, nullptr);
|
||||||
valuesize = count = wcStrSize * 2 + 8 + (useBOM ? 2 : 0);
|
valuesize = count = wcStrSize * 2 + 8 + (useBOM ? 2 : 0);
|
||||||
value = new unsigned char[valuesize];
|
value = new unsigned char[valuesize];
|
||||||
memcpy(value, "UNICODE\0", 8);
|
memcpy(value, "UNICODE\0", 8);
|
||||||
|
Reference in New Issue
Block a user