Qt unicode字串转中文
来源:互联网 发布:活动报名系统源码 编辑:程序博客网 时间:2024/06/09 14:24
有时候,直接在html里面获取的字符串就是带有"\u"的,然后直接显示的时候"\u"也会显示出来。
这里就是教你如何去掉"\u"。
QString filename = "\\u6211\\u662f\\u4e2d\\u6587";do {<span style="white-space:pre"></span>int idx = filename.indexOf("\\u");<span style="white-space:pre"></span>QString strHex = filename.mid(idx, 6);<span style="white-space:pre"></span>strHex = strHex.replace("\\u", QString());<span style="white-space:pre"></span>int nHex = strHex.toInt(0, 16);<span style="white-space:pre"></span>filename.replace(idx, 6, QChar(nHex));} while (filename.indexOf("\\u") != -1);
然后输出filename就是中文了。
0 0
- Qt unicode字串转中文
- qt字串等相转
- C#中文转Unicode、Unicode转中文
- QT 中文转成Unicode 字符显示 \uxxxx
- JAVA UNICODE转中文
- 中文 转 unicode 问题
- unicode 转 中文 ios
- 中文转Unicode
- unicode在线转中文
- unicode转中文
- Java unicode 转中文
- Python unicode 转中文
- 中文转码unicode
- Unicode编码转中文
- c#中文转unicode
- c#unicode转中文
- js unicode转中文
- php unicode转中文
- QT父子与QT对象delete
- 从零开始搭建Node.js, Express, Ejs, Mongodb服务器
- python学习笔记(一)
- 多态
- KEIL工程编译出现Error command-line cannot open preprocessing output output file错误
- Qt unicode字串转中文
- python学习笔记(二)
- codeforces 664B题 Rebus 题解记录了我做这道题从错到对的完整思路
- 常见数据结构(二)-树(二叉树,红黑树,B树)
- UVA 1451 Average(斜率优化)
- 第68篇Chrome扩展USB开发(四)及php及JS
- python学习笔记(三)
- 结构体
- C语言中typedef struct与struct的区别