当前位置:网站首页>Qt中文乱码常量换行符终极解决方案
Qt中文乱码常量换行符终极解决方案
2022-07-26 23:01:00 【令狐掌门】
在Qt项目中,经常出现中文乱码、常量换行符等情况,有时英文字符也会出现“常量换行符”的编译错误,网上也有很多解决方案,不过大都不通用,以至于很多人心态崩溃,放弃学习Qt、喷Qt,觉得Qt垃圾,例如相同QtCreator的设置在别人电脑上是正常的,在你的电脑上就是常量换行符,中文乱码,不管怎么处理都无法通过编译,是不是觉得很崩溃!!!Qt除了授权费较高,其它方面还是很优秀的。出现这种中文乱码、常量换行符,无法处理,是因为你的解决方案不对。
下面列举网上常见的并不很实用的Qt中文乱码、常量换行符解决方案:
- (1)
#pragma execution_character_set("utf-8")
在右中文开的代码文件顶部增加该语句,偶尔也会中文乱码,
- (2)
使用QString::fromLocal8Bit进行转换&#
边栏推荐
- Educational Codeforces Round 132 (Rated for Div. 2), problem: (D) Rorororobot
- Nb-iot networking communication
- The latest JD SMS login + silly girl robot nanny level deployment tutorial (July 24, 2022)
- Codeforces Round #810 (Div. 2), problem: (B) Party
- 通过ensp让静态路由实现全网可达
- js中的数组方法和循环
- 静态路由综合实验
- (史上最详细)Codeforces Round #805 (Div. 3)E. Split Into Two Sets
- C language - array, string handler, strlen, strcpy and strncpy, strcat and strncat, StrCmp and strncmp
- HandsomeForum学习论坛
猜你喜欢

Fist guessing applet based on Object-C novice on the road

Timer interrupt experiment

CAN总线通信应用

Codeforces Round #796 (Div. 2), problem: (1688C) Manipulating History

OSPF路由信息协议-拓扑实验

Record the nth SQL exception

Tim output comparison - PWM

Writing a pacesetter frequently -- yunxiaojing

猜拳小程序 基于Object-C 新手上路

C language -- while statement, dowhile statement, for loop and loop structure, break statement and continue statement
随机推荐
Find a specific number in an ordered array
C语言——二维数组、指针
(title + detailed idea + annotated code) codeforces round 805 (Div. 3) F Equate Multisets
C language -- nesting of relational and logical operators, if statements, switch statements, and branch structures
Use of golang - sync package (waitgroup, once, mutex, rwmutex, cond, pool, map)
Lora网关节点汇聚传感器数据
C language - assignment operator, compound assignment operator, self increasing and self decreasing operator, comma operator, conditional operator, goto statement, comment
NB-IOT联网通信
数字集成电路:MOS管器件章(二)
Lora communication application development
Prometheus 运维工具 Promtool (三) Debug 功能
oSPF基础实验配置
OSPF路由信息协议-拓扑实验
Encyclopedia of websites commonly used by people who know current affairs
Constant knowledge explanation of C language
光光光仔的CSDN之旅
js中的数组方法和循环
excel整行删除,图片一起删除
Codeforces Round #810 (Div. 2), problem: (B) Party
(super detailed version, don't know to comment at any time) codeforces round 804 (Div. 2) C the third problem