All displayed text in my project is in Greek. I didn't use tr()
, just Greek characters directly. And for the correct encoding I was using:
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("ISO 8859-7"));//for Greek
Qt5 took setCodecForCStrings
away , and all the characters are displayed as "???????"
. Is there a workaround?
Please note this is a big project, I want to avoid using code for every string in the program.
Thank you Esailija
So saving all my files with UTF-8 encoding solved the problem.
If you are using Qt Creator, change the default encoding to UTF-8:
Preferences -> Text Editor -> Default Encoding ... choose UTF-8
Then for the existing files go to Edit->Select Encoding and change it to UTF-8
also for anyone wanting more details look here http://www.macieira.org/blog/2012/05/source-code-must-be-utf-8-and-qstring-wants-it/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With