当前位置:网站首页>Qt中文编程遇C2001错误,提示“常量中有换行符”
Qt中文编程遇C2001错误,提示“常量中有换行符”
2022-07-25 22:40:00 【物随心转】
一、问题
QT上用MSVC去编译部分含有中文的字符串时会出现编译错误error: C2001: 常量中有换行符
二、解决方案
解决方法:
1、设置是工具->选项->文本编辑器->行为->UTF-8 BOM设置成“如果编码是UTF-8则添加”
2、在头文件或.cpp文件,加上#pragma execution_character_set("utf-8")
3、使用记事本打开文件,另存文件为带BOM头 utf-8 格式

参考:
边栏推荐
- [training Day11] Nescafe [greed]
- Domain oriented model programming
- Div drag effect
- Von Neumann architecture
- Gan, why '𠮷 𠮷'.Length== 3 ??
- Document flow definition, box model related knowledge
- The new media operation strategy (taking xiaohongshu as an example) helps you quickly master the creative method of popular models
- Interview question 17.11. word distance ●●
- 冯诺依曼体系结构
- 【集训DAY15】Boring【树形DP】
猜你喜欢
![[training Day11] Calc [mathematics]](/img/a7/cbb33f0c241e1bad90a282bba990d1.png)
[training Day11] Calc [mathematics]

对需求的内容进行jieba分词并按词频排序输出excel文档

Ffmpeg plays audio and video, time_ Base solves the problem of audio synchronization and SDL renders the picture

ML-Numpy

软件测试 pytest pytest的命名规则 用例的前后置 conftest.py 定制allure报告 @pytest.mark.parametrize()装饰器作数据驱动

【集训DAY12】X equation 【高精度】【数学】
![[training Day12] min ratio [DFS] [minimum spanning tree]](/img/f8/e37efd0d2aa0b3d79484b9ac42b7eb.png)
[training Day12] min ratio [DFS] [minimum spanning tree]

科大讯飞智能办公本Air电纸书阅读器,让我的工作生活更加健康

Von Neumann architecture

Two methods of printing strings in reverse order in C language
随机推荐
Platform architecture construction
【集训DAY12】树!树!树!【贪心】【最小生成树】
科大讯飞智能办公本Air电纸书阅读器,让我的工作生活更加健康
Box model (2)
面向领域模型编程
If it is modified according to the name of the framework module
LabVIEW develops PCI-1680U dual port can card
Simple application of partial labels and selectors
Builder pattern
Matrix of C language
Smart S7-200 PLC channel free mapping function block (do_map)
(1) DDL, DML, DQL, DCL and common data types
DOM event binding
Method of converting MAPGIS format to ArcGIS
汇编语言与微机原理实验一、实验二、实验三:分支程序设计/循环程序设计/子程序设计
[training Day11] Nescafe [greed]
平台架构搭建
JSON object
IPv4 addresses have been completely exhausted, and the Internet can work normally. NAT is the greatest contributor!
ECMA 262 12 Lexical Grammer