赞
踩
Windows+QCreator+Qt+MSVC
项目->Project Settings->编辑器->文件编码:
1.设置默认编码为:UTF-8
2.设置UTF-8 BOM为:如果编码是UTF-8则添加
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
globaldefine.h
#include <QTextCodec>
extern QTextCodec *codec;
#define TU codec->toUnicode
globaldefine.cpp
QTextCodec *codec = QTextCodec::codecForName("utf-8");
选中源文件,鼠标右键,点击:Add UTF-8 BOM on Save,并保存。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。