QString encoding problem
-
I write code on windows and run it on raspberry pi.
- QString("character");
- QString::fromLocal8Bit("character");
- QString::fromUtf8("character");
When outputting to the screen in 3 ways in Windows, only 2 succeeds, and characters 1 and 3 are broken. However, all characters are broken when running on Raspberry Pi.
Are there any other encoding methods?
What should I look for to solve the problem?
thank you for reading my poor english
-
@LISP said in QString encoding problem:
Characters are displayed as squares or unknown characters.
Which ones? And where (on the console, in your gui?) Non-ascii ones? If so make sure your source code is utf-8 and your compiler treats it as utf-8. Also please provide some code so we can see what you're doing. What Qt version do you use?
-
I write code on windows and run it on raspberry pi.
- QString("character");
- QString::fromLocal8Bit("character");
- QString::fromUtf8("character");
When outputting to the screen in 3 ways in Windows, only 2 succeeds, and characters 1 and 3 are broken. However, all characters are broken when running on Raspberry Pi.
Are there any other encoding methods?
What should I look for to solve the problem?
thank you for reading my poor english
-
@LISP said in QString encoding problem:
Characters are displayed as squares or unknown characters.
Which ones? And where (on the console, in your gui?) Non-ascii ones? If so make sure your source code is utf-8 and your compiler treats it as utf-8. Also please provide some code so we can see what you're doing. What Qt version do you use?