[SOLVED] How to display Japanese character with Qt5.3 on a Japanese machine
-
Hi:
Our product shows lots of garbage characters with Qt5 on a Japanese machine :( I guess the reason is the removal of setCodecForCStrings and Qt now expects the source code to use UTF8.
I saw some posts suggested to save the file to Unicode, unfortunately it is impossible for us to do it. Besides, we are still passing the strings around as char* or std::string >.< Any suggestion of other workarounds?
Thanks,
-Ollie -
Hi,
[quote author="Ollie" date="1402788045"]
I saw some posts suggested to save the file to Unicode, unfortunately it is impossible for us to do it.[/quote]I'm curious: Why not?One workaround is to use manually pass your C strings through a "QTextCodec":http://qt-project.org/doc/qt-5/qtextcodec.html to convert them to Unicode
-
[quote author="JKSH" date="1402818487"]Hi,
I'm curious: Why not?
One workaround is to use manually pass your C strings through a "QTextCodec":http://qt-project.org/doc/qt-5/qtextcodec.html to convert them to Unicode[/quote]
Thanks JKSH, the QTextCodec::toUnicode works fine.
Technically it may be possible, but we are so close to the deadline, trying to find a easy way out here XD
Thanks,
-Ollie -
I see. Glad I could help. All the best with your project! :)
P.S. Please edit your original post to add "[SOLVED]" to the title