The International Simutrans Forum

Development => Technical Documentation => Topic started by: jamespetts on December 27, 2014, 10:40:23 PM

Title: Unicode query
Post by: jamespetts on December 27, 2014, 10:40:23 PM
Is Simutrans supposed to support the extended Unicode character set in the GUI? When I tried to use a unicode character representing a clock face in Experimental (the character is: ?), it was replaced in game with "??".
Title: Re: Unicode query
Post by: Ters on December 27, 2014, 11:20:52 PM
I've never heard of any "extended Unicode character set", and the character you posted won't even show up in Firefox on Linux. Could you post the code point value? In any case, what Simutrans can display depends on the font.
Title: Re: Unicode query
Post by: jamespetts on December 27, 2014, 11:28:07 PM
I found the symbol here (http://www.alanwood.net/demos/wingdings.html). It apparently has a code of U+1F551 or 128337.
Title: Re: Unicode query
Post by: DrSuperGood on December 28, 2014, 01:23:08 AM
It depends I would imagine. At times it looks like much of the dialog (eg the network join details and errors) use only standard ASCII "char" type instead of "wchar". Unless I am missing some strange compiler behaviour of course.
Title: Re: Unicode query
Post by: Ters on December 28, 2014, 10:30:53 AM
Quote from: DrSuperGood on December 28, 2014, 01:23:08 AM
It depends I would imagine. At times it looks like much of the dialog (eg the network join details and errors) use only standard ASCII "char" type instead of "wchar". Unless I am missing some strange compiler behaviour of course.

Simutrans, like the *nix world, uses UTF-8 when it does Unicode. wchar_t is very wasteful on *nix, with 300% overhead for most of the world. Windows doesn't waste as much space on wchar_t, but is as difficult to use as char with UTF-8 anyway.
Title: Re: Unicode query
Post by: prissi on January 06, 2015, 10:10:51 PM
Extended unicode support is not very widespread, and simutrans only supports characters until 65535. However, there are four used defined characters in this range. Deinfe your clock as one of them. Or better, make it a symbol from the dat files ...
Title: Re: Unicode query
Post by: jamespetts on January 06, 2015, 10:30:05 PM
Can a symbol from the .dat files be inserted into text?
Title: Re: Unicode query
Post by: prissi on January 24, 2015, 11:04:20 PM
Not really; but you can define th elower coderange (1-31) with characters form a default font. THe unicode font usually does not touch these.

MAybe do it like the smilies in the halt dialogue.