[solved] How can I set some native special characters (e.g. for german language: ÜöäÄÖß) with 'LabelTTF'

Using Visual Studio 2012 and ‘Use Unicode Character Set’ is choosen on the Property Pages.

But my ‘ü’ is printed like a ‘?’. What is wrong on the code snippet?

auto label = LabelTTF::create("Vanessa's - Drück Mich!", "Arial", 24);

looks like this one:

Vanessa's - Dr?ck Mich!

Try using utf-8 encoding.

your file must be utf8-encoded :slight_smile: in windows i thinks this ISN’T default :slight_smile:

on linux such example works

Thanks. Works now!

Solution:
Changing the ‘source file’ encoding to UTF-8

Hi,

I still can not display UTF8 characters in sample HelloWorld project. I changed cpp and header files encoding to Unicode (UTF-8 with signature) by using “Advanced Save Options” and also i used setlocale function, but I can not see any changes. Is there any other way to change file encoding or am I doing something wrong?

Thanks.

Eventually I found the reason of the error. Actually Visual Studio “Advanced Save Options” is not working properly. I saved all the cpp and header files several times with this option but I saw that the files are not saved as UTF8 properly. I am working with Turkish characters like “şüı” and when I debug the code deeply in the cocos2d Label->setString function ş character’s code is shown as “-2”. After this strange state I opened the file with PSPad and noticed that the file is not saved as UTF8. I saved all the files with PSPad again and the problem is solved.