Qt5.5.1, wrote a line of code only qDebug () & lt;
CodePudding user response: It doesn't matter, this does not affect writing code, because even if the program won't be garbled, when just debug print Chinese is garbled CodePudding user response:
reference 1st floor u013466477 response: it doesn't matter, this does not affect writing code, because even if the program won't be garbled, when just debug print Chinese is stil but it's not convenient, hope can solve this problem CodePudding user response:
refer to the second floor yuyu414 response: Quote: refer to 1st floor u013466477 response: It doesn't matter, this does not affect writing code, because even if the program won't be garbled, when just debug print Chinese is stil but it is not convenient, hope can solve this problem That not too clear, QMessageBox prompt out also CodePudding user response:
My garbled and you are not the same ah, I was 2 into the system, how to deal with, bosses CodePudding user response:
Out of the question if you want to know the reason, the first code is no problem, the code is encoding problem, your code is utf-8, what you see when you compile the compilation of code, CodePudding user response:
Just two days before, to be clear in the compiler coding way, also have to understand every place encoding to use, as long as the corresponding normal, according to some coding can be compatible with normal display, CodePudding user response:
As long as it is stil, affirmation is not compatible or not show the corresponding coding way CodePudding user response:
To come to see me, my solution: https://www.cnblogs.com/yjphhw/p/9967294.html CodePudding user response:
Windows with the default file is saved by gb2312 or cp936 QString default is unicode encoding to save, can try # 8 way or a QString: : fromLocal8Bit CodePudding user response:
refer to 6th floor y972239567 response: just two days before, to be clear in the compiler coding way, also have to understand every place encoding to use, as long as the corresponding normal, according to some coding can be compatible with normal, according to Are you sure? Have tried? This is not your so-called Chinese garbled CodePudding user response:
Qdebug () toxic, the output is not recommended in Chinese, we don't know this what is the output "application" code CodePudding user response:
If your project source code as the utf-8 encoding, so suggest to qDebug () & lt; CodePudding user response: 1. A QString STR=QString: : fromLocal8Bit (" Chinese ");//vs2008 vs2005 2. A QString STR=QString: : fromLocal8Bit (" Chinese ");//GCC vs2003, such as the source code is GBK code (ANSI code in notepad) 3. A QString STR=QString: : fromUtf8 (" Chinese ");//GCC vs2003, such as the source code is utf-8