当前位置:网站首页>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进行转换&#
边栏推荐
- Codeforces Round #809 (Div. 2), problem: (C) Qpwoeirut And The City
- Use of golang - sync package (waitgroup, once, mutex, rwmutex, cond, pool, map)
- hcip--ospf接口网络接口类型实验
- Northeast Securities stock online account, is it safe to open an account on your mobile phone
- Solve prime numbers between 100 and 200
- Can bus communication application
- About unsafe problems such as fopen and strError encountered in vs2022 or advanced version running environment
- First knowledge of C language (2)
- Fist guessing applet based on Object-C novice on the road
- Handsomeforum Learning Forum
猜你喜欢

面试必问 | 一个线程从创建到消亡要经历哪些阶段?

全连MGRE与星型拓扑MGRE

数字芯片的面积优化:第三届“华为杯”研究生创芯大赛数字方向上机题1详解

Hcip bidirectional republication and routing strategy

Esp8266wi fi data communication

多线程中 synchronized 锁升级的原理是什么?

HCIP-第二天

Explain exi interrupt through the counting experiment of infrared sensor

RS-485 bus communication application

记录第N次SQL异常
随机推荐
Esp8266wi fi data communication
【在Visual Studio 2019中使用SQLite3库实现学生信息管理系统】
Full company mGRE and star topology mGRE
静态路由实验配置
Risc-v tool chain compilation notes
Prompt to leave the page
Wechat applet: user wechat login process (attached: flow chart + source code)
今天浅讲一下转义字符【萌新版】
记录第N次SQL异常
On the first day of staying in the blog [for 80000]!
睡不着时闭眼躺着,到底有没有用?
(史上最详细)Codeforces Round #805 (Div. 3)E. Split Into Two Sets
N methods of SQL optimization
ESP8266Wi-Fi接入云平台
Nb-iot networking communication
Golang -- parse yaml file
C language - first program, print, variables and constants
三个整数从大到小排序(详细介绍多种方法)
How to judge whether a number is odd or even?
HCIP-第六天-OSPF静态大实验