Use the source file to save the string, the format of UTF-8, so that the xml file is read, and then the display will not garbled.
Another advantage of doing so is to make it easier to internationalize the world in the future.
Xml file:
[Html]
<Dict>
<Key> Hello </key>
<String> Hi ~ Chinese characters can be displayed normally! </String>
</Dict>
<Dict>
<Key> Hello </key>
<String> Hi ~ Chinese characters can be displayed normally! </String>
</Dict>
Display:
[Cpp]
Const char * Hello = (CCString *) strings-> objectForKey ("Hello")-> m_sString.c_str ();
CCLabelTTF * pLabel1 = CCLabelTTF: create (Hello, "Arial", 24 );
PLabel1-> setPosition (ccp (size. width/2, size. height/2 ));
This-> addChild (pLabel1 );
Const char * Hello = (CCString *) strings-> objectForKey ("Hello")-> m_sString.c_str ();
CCLabelTTF * pLabel1 = CCLabelTTF: create (Hello, "Arial", 24 );
PLabel1-> setPosition (ccp (size. width/2, size. height/2 ));
This-> addChild (pLabel1 );
Effect: