StupidBeauty
Read times:611Posted at:Mon Jul 15 20:57:00 2013
- no title specified

Qjson0.7.1输出中文时会乱码,升级到0.8.1就好了

一个项目,用qjson0.7.1版本来输出中文时,会这样:

RegisterService.cpp 55 indexRequested "FailReason:" "此用户名已经存在:d"

RegisterService.cpp 98 indexRequested "JsnStr:" "{ "failreason" : "æ­¤ç¨æ·åå·²ç»å­å¨ï¼d", "success" : false }"

上面一行是原本要输出的中文,下面一行是qjson输出之后的JSON字符串 ,可以看到failreason字段已经成了乱码了。

升级到0.8.1 ,得到的JSON字符串

{ "failreason" : "\u6b64\u7528\u6237\u540d\u5df2\u7ecf\u5b58\u5728\uff1ahxcan", "success" : false }

中文都被转义了,这才是正常的。客户端收到之后,会自动反转义。

Billen kiekjes

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4