Bug 799210 - Bad encoding of accented chars in account names in...

"Import CSV" wizard

In MSWin the UnicodeString(char*) ctor assumes that the input string
is encoded in the current codepage, but the input to
gnc_list_formatter is encoded in UTF8. Use the static class function
UnicodeString::fromUTF8 instead.
This commit is contained in:
John Ralls 2024-01-06 10:30:14 -08:00
parent 2918577a3d
commit b2fa3ef106

View File

@ -1665,7 +1665,10 @@ gnc_list_formatter (GList *strings)
std::string retval;
for (auto n = strings; n; n = g_list_next (n))
strvec.push_back (static_cast<char*>(n->data));
{
auto utf8_str{static_cast<const char*>(n->data)};
strvec.push_back (icu::UnicodeString::fromUTF8(utf8_str));
}
formatter->format (strvec.data(), strvec.size(), result, status);