cocos2dx在VS下Label中文显示乱码…

来源:互联网 发布:淘宝旅行网日本签证 编辑:程序博客网 时间:2024/05/16 23:35
主要是编码问题,可以将中文字符串放在一个独立的utf-8文件中,然后在程序中读取。如:
cocos2dx在VS下Label中文显示乱码的解决方法。

将上面的代码用记事本保存为utf-8的xml文件。
在程序中读取:
 auto strDic=Dictionary::createWithContentsOfFile("cnString.xml");
auto str=((String*)strDic->objectForKey("type1"))->getCString(); 
auto pokerTypeLabel=LabelTTF::create(str,"",50);
addChild(pokerTypeLabel);




0 0
原创粉丝点击