Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
直接在代码中使用中文字符串,在Windows下无论用QCreator还是Visual Studio 都会出现中文字符串显示乱码问题
原因是QString默认使用Ascii编码,要手动加入代码
“QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale)”才能解决问题
为什么Qt不默认就是使用QTextCodec::codecForLocale呢?这对各个国家都没有冲突啊
呵呵,如果这样做,Qt岂不是知道倒退了10多年? 你提到这个是10多年前的做法吧,直接导致同一个程序无法跨平台了。在utf8盛行的时代,而VC6/7/8/9/...,默认采用locale字符集,也算是与时代有些格格不入了