Cocos2d-x android Character set problem

Cocos2d-x android Character set problem
0.0 0


I am new to Cocos2d-x and I am using it for android.
I find that Cocos2d-x is writen with ANSI format, and my game code(by C++) is writen with unicode, and when I try to build the game code to so file,
it fail, but if transfer game code to ANSI format, it success.
So do I have to transfer unicode format to ANSI, or transfer all related Cocos2d-x code to unicode?
Can anyon give any suggestion?
Thanks so much!


I think you have to save all your source codes as UTF-8 encoding.
cocos2d-x use const char * or std::string, but you still can store UTF-8 chars in it without problem.
If the complier sees that your source code is UTF-8 encoding, it will treat all " " strings as UTF-8 char string.


yes, if I save all my code to UTF-8, everything works well on x86,
but will crash on Android as and Chinese cann’t display nomally,
if I change to “UTF-8 + BOM” for android, Chinese can display normally but crash also.
I am investigating the android crash problem.