Author Topic: Unicode query  (Read 1877 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15842
  • Total likes: 405
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Unicode query
« 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 "??".
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4861
  • Total likes: 201
  • Helpful: 108
  • Languages: EN, NO
Re: Unicode query
« Reply #1 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.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15842
  • Total likes: 405
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Unicode query
« Reply #2 on: December 27, 2014, 11:28:07 PM »
I found the symbol here. It apparently has a code of U+1F551 or 128337.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline DrSuperGood

Re: Unicode query
« Reply #3 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4861
  • Total likes: 201
  • Helpful: 108
  • Languages: EN, NO
Re: Unicode query
« Reply #4 on: December 28, 2014, 10:30:53 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8821
  • Total likes: 322
  • Helpful: 229
  • Languages: De,EN,JP
Re: Unicode query
« Reply #5 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 ...

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15842
  • Total likes: 405
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Unicode query
« Reply #6 on: January 06, 2015, 10:30:05 PM »
Can a symbol from the .dat files be inserted into text?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8821
  • Total likes: 322
  • Helpful: 229
  • Languages: De,EN,JP
Re: Unicode query
« Reply #7 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.