Displaying non-english text

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
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Displaying non-english text

Post by ejik »

Hello!

I have a small program which shows some GUI elements (combo boxes etc...). Combo boxes are filled from XML files using IrrXML's createIrrXMLReader and getAttributeValue.
I looked inside of XML and saw EF BB BF (hex) sequence at the beginning. As I understand, it is of UTF8 format.

If values are written in english, they are displayed okay.
But if values are written in russian, problems begin:
I see hieroglyphs. Also, I noticed that the quantity of charachters displayed is two times bigger than there is in the word.

What am I doing wrong?
Does Irrlicht support displaying languages other that english?
CuteAlien
Admin
Posts: 10045
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

First you have to make sure that your font actually contains cyrillic characters. The default bitmap fonts don't have those - so you might have to create an own font or use ttf instead. Utf8 should be possible to use, though I haven't used it with irrXML so far myself (because it can only read but not write it). Within the engine strings are kept as widechars which will work with cyrillic.

There might be some more problems with russian. I once wrote an article about it when I translated an application, I just hope it's not too outdated by now: http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply