Cyrillic symbols in ITextSceneNode

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Sfortza
Posts: 39
Joined: Thu Mar 17, 2011 12:40 pm
Location: 184

Cyrillic symbols in ITextSceneNode

Post by Sfortza »

Mobile game on Android.
I'm using ITextSceneNode to show players names.

Name can be written in Russian.
I get it from server, convert from Java to C++ through JNI.
(GetStringUTFChars)

As a result I get name as const char*.
ITextSceneNode requires text as wchar_t*.

To convert the text from const char* to wchar_t*
i'm using stringw

Code: Select all

Name = stringw(my_utf_char_string)
After that I pass the result string to the ITextSceneNode constructor.

Code: Select all

smgr->addTextSceneNode(font, 
                                               Name.c_str(), 
                                               SColor(100, 255, 255, 255), 
                                               playerNode, 
                                               position,
                                               -1); 
But Russian symbols are displayed incorrectly.
When I'm using English symbols they are displayed correctly.
Font 'font' contains cyrillic symbols.

What I'm doing wrong?

Thank you!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Cyrillic symbols in ITextSceneNode

Post by hybrid »

Probably the wrong code map. You need to create the font with the font code map you use on the target system. Or you use the unicode patches from the forum.
Sfortza
Posts: 39
Joined: Thu Mar 17, 2011 12:40 pm
Location: 184

Re: Cyrillic symbols in ITextSceneNode

Post by Sfortza »

Hybrid, thank you very much!
Post Reply