当前位置:网站首页>What is the difference between tolocal8bit and toutf8() in QT
What is the difference between tolocal8bit and toutf8() in QT
2022-06-30 19:51:00 【hebao0】
take QString When a string is written to a file , I usually borrow QByteArray As an intermediate variable , There are two ways .
QString::toUtf8 It's output UTF-8 Coded character set
QString::toLatin1 Is equivalent to ASCii If the code does not contain Chinese, it will be converted to... By default ascii code 0x3f That's the character ’?‘
QString::Local8bit Is the character set encoding set by the local operating system , It's usually GB2312.
View the character set encoding set by the local operating system , start-up cmd , Input chcp,
The activity code page is 936, intend " China - Simplified Chinese (GB2312)"
QFile file("out.txt");
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return;
QString msg = " ha-ha ";
QByteArray byte= msg.toLocal8Bit();
file.write(byte);
file.close();

ANSI code (American National Standards Institute), In China, , It's understood here as GB2312 that will do
边栏推荐
- Force deduction ----- count the string containing the given prefix
- 4.3寸触控屏12路控制端口可编程网络中控支持5台中控主机相互备份
- 传输层 使用滑动窗口实现流量控制
- 新出生的机器狗,打滚1小时后自己掌握走路,吴恩达开山大弟子最新成果
- MySQL数据库查询优化
- Spark - 一文搞懂 Partitioner
- IT外包驻场人员怎么定位自己的痛点?
- 解决arm_release_ver of this libmali is ‘g2p0-01eac0‘,rk_so_ver is ‘4‘,libgl1-mesa-dev不会被安装,存在未满足的依赖关系
- 线上线下双结合,VR全景是家具线上转型好方法!
- SSM整合流程(整合配置、功能模块开发、接口测试)
猜你喜欢

【NLP】【TextCNN】 文本分类

MySQL billing Statistics (Part 1): MySQL installation and client dbeaver connection

2022 最新 JCR正式发布全球最新影响因子名单(前600名)

Makefile笔记(一文学会Makefile)

KubeVela 1.4:让应用交付更安全、上手更简单、过程更透明

盘点华为云GaussDB(for Redis)六大秒级能力

mysql统计账单信息(上):mysql安装及客户端DBeaver连接使用

正则系列之字符类

标配10个安全气囊,奇瑞艾瑞泽8安全防护无死角

Data intelligence - dtcc2022! China database technology conference is about to open
随机推荐
Graduates
Data intelligence - dtcc2022! China database technology conference is about to open
discuz 论坛提速之删除data/log下的xxx.php文件
c语言数组截取,C# 字符串按数组截取方法(C/S)
Ten percent of the time, the tar command can't parse the English bracket "()" when decompressing the file
说实话ThreadLocal真不是啥高级的东西
A necessary tool for testing -- postman practical tutorial
哪个券商佣金的佣金最低?另外,手机开户安全么?
【多线程】使用线程池、实现一个简单线程池
6-1漏洞利用-FTP漏洞利用
数据智能——DTCC2022!中国数据库技术大会即将开幕
启动PHP报错ERROR: [pool www] cannot get uid for user ‘@[email protected]’
Cartoon | has Oracle been abandoned by the new era?
解决arm_release_ver of this libmali is ‘g2p0-01eac0‘,rk_so_ver is ‘4‘,libgl1-mesa-dev不会被安装,存在未满足的依赖关系
The former king of fruit juice sold for 1.6 billion yuan
【NLP】【TextCNN】 文本分类
MySQL billing Statistics (Part 1): MySQL installation and client dbeaver connection
英语没学好到底能不能做coder,别再纠结了先学起来
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
Advanced skills of testers: a guide to the application of unit test reports