/* VS2010 记得一定要打上SP1补丁*/
//VC2010~2015 必须加入这行预编代码
#pragma execution_character_set("utf-8")
#VS2017 必须在编译器中设置,这是QT的PRO设置,source-charsetr指源代码、execution-charset编译后的程序或库,可以直接加入 QMAKE_CXXFLAGS += /utf-8
contains( CONFIG, "msvc" ): QMAKE_CXXFLAGS += /source-charset:utf-8 /execution-charset:utf-8
contains( CONFIG, "msvc" ): QMAKE_CFLAGS += /source-charset:utf-8 /execution-charset:utf-8
#VS2017 必须在编译器中设置,这是QT的PRO设置, 直接/utf-8时,有些编译器不支持
contains( CONFIG, "msvc" ): QMAKE_CXXFLAGS += /utf-8
contains( CONFIG, "msvc" ): QMAKE_CFLAGS += /utf-8
QT+MSVC的UTF-8配置、MSVC的UTF-8配置
于 2022-04-03 08:38:46 首次发布