当前位置:网站首页>QT transfers the received JSON data (including Chinese) Unicode to utf8
QT transfers the received JSON data (including Chinese) Unicode to utf8
2022-06-10 14:07:00 【There is heavy snow in the South】
Recently in use qt adopt json Data format transfer data , Receive from device to qt Interface data display , There's a problem , The specific reasons for this are still in place .cpu adopt json Transfer data information to qt End , Because the data information contains Chinese , Chinese characters will be converted by default unicode Format transfer , In this way qt End receiving and parsing json Data time , If the amount of data is too large , Will cause parsing json The data of failure , Cannot find corresponding string ( The exact reason is unknown , The judgment should be caused by this reason ), The amount of data is relatively small, and this problem does not occur for the time being .
The method to avoid this problem can transcode the received data , To utf8:
LocalSocket::instance()->recvMsg(msg);// Received data
QTextCoder *code = QTextCodec::codevcForName("utf-8");
QByteArray msgUtf8 = code->fornUnicode(msg);// Transcoded data msgUtf8
边栏推荐
- 为doc2vec生成训练向量的数据集
- SIGIR 2022 | 港大、武大提出KGCL:基于知识图谱对比学习的推荐系统
- 2022 examination question bank and online simulation examination for main principals of hazardous chemical business units
- 「大模型」之所短,「知识图谱」之所长
- 大厂面试上午10:00面试,10:09就出来了 ,问的实在是太...
- [notes] some records of 74hc573
- 组装芯片难保竞争优势,痛定思痛的高通终于开始自研核心架构
- [special introduction] round table forum -- the integration of AI and audio and video technology
- The shortcomings of the "big model" and the strengths of the "knowledge map"
- 【笔记】C语言数组指针、结构体+二维数组指针小记
猜你喜欢

Leetcode 2293. 极大极小游戏(可以.一次过)

618 大促来袭,浅谈如何做好大促备战

基于FPGA的VGA协议实现

Microsoft Word tutorial, how to change margins and create a newsletter column in word?

《软件体系结构原理、方法与实践》第二版期末考试复习总结

2022年制冷与空调设备运行操作理论题库模拟考试平台操作
![[note] about the problem of insufficient compilation mapping memory in keil](/img/0d/789c7629823600dbc77e62744ef5a1.png)
[note] about the problem of insufficient compilation mapping memory in keil

【笔记】74HC573的一些记录
![[notes] notes on C language array pointer, structure + two-dimensional array pointer](/img/77/5923754b12ccfe0bcba7e46617de86.png)
[notes] notes on C language array pointer, structure + two-dimensional array pointer

40 necessary methodologies for large factories
随机推荐
CVPR 2022 | 基于序列对比学习的长视频逐帧动作表示
【离散数学期复习系列】三、集合的概念及运算
UE5如何将屏幕坐标转为世界坐标和世界方向
C multithreading learning note 3
大厂必备的40个方法论
[discrete mathematics review series] IV. figure
Flutter 页面跳转 传参,TabBar学习总结5
Leetcode 2293. Minimax game (yes. One pass)
Microsoft Word 教程,如何在 Word 中更改页边距、创建新闻稿栏?
How to write a global notice component?
多云管理平台cmp是什么意思?谁能清楚解释一下
The interview at the big factory was held at 10:00 a.m. and came out at 10:09 a.m. the question was really too
【专题介绍】圆桌论坛——AI与音视频技术的融合之路
初学者自己搭建博客的设计工具和技巧
组装芯片难保竞争优势,痛定思痛的高通终于开始自研核心架构
单例模式和特殊类设计
解决安装gerapy的时候报错:ERROR: Cannot uninstall ‘certifi‘. It is a distutils installed project...
2022广东省安全员A证第三批(主要负责人)考试练习题及在线模拟考试
软件智能:aaas系统 度量衡及文法的形式规则
[notes] notes on C language array pointer, structure + two-dimensional array pointer