我用http请求了一个连接,发送回来的数据是类似 \u60a8\u597d 这样的字符,我用其他网站上提供的unicode解码可以解出“您好”,我想请问一下,在cocoslua 或者 cocos中有提供类似的方法用于解码吗?在 json 中有类似方法吗?谢谢。
备注:引擎版本3.0
有大神帮帮忙吗?
#include “stdafx.h”
#include <Stdio.h>
#include <Windows.h>
int main(int argc, char* argv])
{
char czChinese;
wchar_t wcChinese;
wcChinese = *L"\u60a8\u597d";
wcChinese = 0;
WideCharToMultiByte(CP_ACP, 0, wcChinese, -1, czChinese, sizeof(czChinese), NULL, NULL);
printf("输出转换后的结果为: %s", czChinese);
getchar();
return 0;
}
这是我找到一个 c++ 的转换的代码,但是只能转换一个字呢?
唉,发的帖没一个有回复……
我做过,留下你的qq,明天上班给你发转换代码
呵呵,不要失望,不要放弃
499247403 谢谢!
集成cjson模块即可,不仅提高json的解析速度,上面的问题随之解决
请问有链接吗?麻烦发一个谢谢。
cocos2d-x2.x cocos2d-x3.x我都用过,效果还不错
你好,我xcode使用cjson,报错
Undefined symbols for architecture arm64:
“_luaopen_cjson”, referenced from:
_luax_exts in libluacocos2d iOS.a(lua_extensions.o)
请教下要怎么弄?