Game Development Community

Can't use unicode

by Walter Yoon · in Torque Game Engine · 12/13/2005 (2:34 am) · 4 replies

The TDN resource on unicode listed here clearly shows the starter.fps title screen using Asian characters, but doesn't say how exactly one would go about doing it (which files to edit, what fonts to define, etc).

I'm trying to replicate it on my own, but specific information on actually doing it is rather sparse. I've been told that it should "just work", but I'm having no luck doing so.

For example, I tried changing the button text in the file starter.fps/client/ui/mainMenuGui.gui, but when I run the torquedemo.exe the buttons end up like this. Font-wise, several times I've already tried changing every *.cs and *.gui reference from Arial to different fonts, to no avail.

Can anyone please provide me specific information on how how to get unicode charaters to display properly? Even a simple example would be appreciated.

#1
12/13/2005 (3:34 am)
First you need to either change an existing or create a new GuiControlProfile that specifies a font that has the characters you need. In those screenshots, I was either using SimHei or SimSun, I forget which.

Second, you need to make sure your .gui file is saved as UTF-8.

That should be it.

T.
#2
12/13/2005 (6:24 am)
Quote:Second, you need to make sure your .gui file is saved as UTF-8.

Whenever I do that, the demo locks up right after the GarageGames logo screen. I'm stuck with an unresponsive black screen, and can only quit using alt-F4.
#3
12/13/2005 (7:11 am)
Quote:Whenever I do that, the demo locks up right after the GarageGames logo screen. I'm stuck with an unresponsive black screen, and can only quit using alt-F4.

Okay, I discovered why it wasn't working. Notepad doesn't convert to UTF-8 properly. >_< I used a different app to convert to UTF-8, and now it finally "just works". Thanks for the help.
#4
12/13/2005 (7:45 am)
I use TextPad personally and have never had any problems with Unicode. You can choose what character encoding to use when saving and it works nicely. Also, I forgot to mention, make sure the editor doesnt save a BOM, otherwise it confuses the compiler and the .gui wont load. That's probably what happened with Notepad.

T.