Problem trying to convert (const char*) type string with Japanese characters to std::wstringstream #1255
Unanswered
IgnacioBMY
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
Thanks for let me write here.
I have a code like this:
//xmlDocument is a variable of type tinyxml2::XMLDocument and it contains Japanese characters
tinyxml2::XMLPrinter var_xmlp(nullptr, true, 0);
xmlDocument.Print(&var_xmlp);
auto result = var_xmlp.CStr();
std::wstringstream stream;
stream << result;
While I am debugging I can see that "result" contains the correct Japanese characters; however, after assign "result" to "stream", the Japanese characters are garbled into "stream".
Also, due to my company's requirements, I have to solve this issue using standard library.
So, my question is: does anyone know a way to convert a (const char*) string with Japanese characters to a std::wstringstream string using just the standard library (STL)?
Thank you very much for your help and best regards,
Ignacio
Beta Was this translation helpful? Give feedback.
All reactions