How to use CCLabelTTF rendering some chinese character in windows phone 8

i write some test code here

CCLabelTTF* pLabel = CCLabelTTF::create("呵呵", "Arial", 24);

but it show ‘口A口’ in the screen.i find some QA in google.convert the gb2312 to utf-8 but the result is still the same. is there some problem to use chinese with cocos2dx2.2.2 in wp8.


QQ图片20140208155535.jpg (30.2 KB)

I use arialuni.ttf in Resources\fonts to show Chinese, pr: https://github.com/cocos2d/cocos2d-x/pull/5223, it test Ok in TextInputTest.cpp and LabelTest.cpp. Windows Phone does not allow access to system fonts from C++.

Jingchen chen wrote:

I use arialuni.ttf in Resourcesonts to show Chinese, pr: [[https://github.com/cocos2d/cocos2d-x/pull/5223]], it test Ok in TextInputTest.cpp and LabelTest.cpp. Windows Phone does not allow access to system fonts from C++.

page 404

i am sorry the page is ok
the brower convert some word in the URL

Jingchen chen wrote:

I use arialuni.ttf in Resourcesonts to show Chinese, pr: [[https://github.com/cocos2d/cocos2d-x/pull/5223]], it test Ok in TextInputTest.cpp and LabelTest.cpp. Windows Phone does not allow access to system fonts from C++.

i test the code but it is still not right

You have to download the arialuni.ttf into the directory of Resources\fonts, and make sure the .cpp file is utf-8 coding. and use code CCLabelTTF *pLable = CCLabelTTF::create(“中国”, “fonts/arialuni.ttf”, 30). It can be OK. If you have any question, contact me, qq:450928375.

“utf-8 without signature” encoding can show the chinese char, but in some case it will make a lot of compiling error when you use vs2012
“utf-8 with signature” and “gb2312” encoding make chinese char using gb2312 encoding actually, no matter the cpp file is encoding utf-8 or gb2312

In the end,i use the following code

inline string GB2312ToUTF8(const char* pStrGB2312) { 
string out = "";
// to wide char
int nStrLen = MultiByteToWideChar(936, 0, pStrGB2312, -1, NULL, 0);  
wchar_t* pWStr = new wchar_t[nStrLen + 1];  
memset(pWStr, 0, nStrLen + 1);  
MultiByteToWideChar(936, 0, pStrGB2312, -1, pWStr, nStrLen);  

// to utf-8  
nStrLen = WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, NULL, 0, NULL, NULL);  
char* pStr = new char[nStrLen + 1];  
memset(pStr, 0, nStrLen + 1);  
WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, pStr, nStrLen, NULL, NULL);  
if(pWStr) {  
    delete[] pWStr;  
}
if (pStr) {
	out = pStr;
	delete[] pStr;
}
return out;  
}

i pass the 936 code page to MultiByteToWideChar first param. it is worked. 936 code page is just the save option’s code page.

Is arialuni.ttf free for developers or do I need to purchase some licensed version?
From where do I get this font?