I'm transferring a unicode string from one program to another with UTF-8 encoding.
Program that is sending:
Program that is retrieving:
Everything has worked fine, until running on a Japanese edition of Windows.
The "byte path" then looks something like "C:¥Users¥d✝?✝a ,?¥AppData¥Local¥Temp¥file.txt".
"from_bytes()" will throw an std::range_error exception "bad conversion".
The program works fine when working with Japenese writing inside paths in the English edition.
Please help. What could be causing the "bad conversion"?
Program that is sending:
Code:
// Convert path
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_converter;
CString arg = L" /PATH=\"" + CString(utf8_converter.to_bytes(path).c_str()) + L"\"";
Code:
// Restore original path
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_converter;
std::wstring path = utf8_converter.from_bytes( argument );
The "byte path" then looks something like "C:¥Users¥d✝?✝a ,?¥AppData¥Local¥Temp¥file.txt".
"from_bytes()" will throw an std::range_error exception "bad conversion".
The program works fine when working with Japenese writing inside paths in the English edition.
Please help. What could be causing the "bad conversion"?