File: utf8-support.txt

package info (click to toggle)
simutrans 124.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,880 kB
  • sloc: cpp: 160,224; ansic: 9,382; sh: 1,237; awk: 1,081; makefile: 932; javascript: 2
file content (9 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
UTF8 support works very simple:

If the language file is UTF8, then all input/output is handled as UTF8. However, this is only recommended for real multibyte codepages, as SDL just returns keys from Windows/Latin codepages (0...256) and not real UTF8, as far as I could find out. Also, if a font has less than 256 characters, then the font encoding will be ignored at the moment. Otherwise the font encoding must be ISO10626-1 (or what ever Unicode is).

UTF8 files are beginning with "" in UTF8 as very first letter. The line endings must be "\xA" (see the japanese files)

The only exception so far is the citylist, which must be in the same encoding as the language file. But this will also change someday.

If an UTF8 file is encountered in a non UTF8 language, it will be translated to 8Bit Latin (by just ignoring all bits but the lowest 8).