Nick Hodges

Don’t Get Caught with Boxes

17 Jul

If you are a "non-Unicode Kind of Person" like I was just a few short months ago, one of the things that you’ll likely want to do if you want to get into the full features of Tiburon is get your system ready to handle the variety of non-Arabic alphabet fonts that are out there.  Many ANSI-type folks probably haven’t installed the Supplemental Language Support for Windows. If you want to be able to view and use Japanese, Chinese, Arabic, and other alphabets in your Code Editor, you’ll need to install that support.  if you don’t, you might end up with code that looks like this:

Boxes

Those boxes are supposed to be Japanese, Chinese, and Russian characters, but since the full language support isn’t installed on the machine where this screen shot was taken, it displays the boxes instead of the actual characters.

It’s pretty easy to add the functionality (though you’ll likely need your OS disc.  I know that you carefully saved that DVD when you bought your computer, so this won’t be an issue, right?  ;-) ).

RegionalSettings

The steps to add the Supplemental Language support are as follows:

  1. Open the Control Panel
  2. Double click on Regional and Language Option
  3. Go to the "Languages" Tab
  4. In the "Supplemental Language Support", select either or both checkboxes. Check the first one for Arabic, Armenian, Georgian, Hebrew, Indic, Thai, and Vietnamese, and the second ones for Chinese, Japanese, and Korean.
  5. Click Ok and Windows will install the files.  (Windows will likely ask for your Windows DVD.)

Once you do that, the Tiburon IDE will be more than happy to display all different kinds of languages and alphabets.  Note, however, that you’ll need to use a font in the IDE that actually supports the fully Unicode codepage for the language in question.  In the picture below, I’m using Courier New:

UnicodeInTheCodeEditor

(By the way, the above text says "Welcome to the world of Unicode using Delphi 2009!!" in Japanese, Chinese, and Russian.  Or at least I think so — maybe some of my co-workers played a joke on me.  ;-) )

And here’s the actual code being run in the application:

UnicodeApp

19 Responses to “Don’t Get Caught with Boxes”

  1. 1
    ua.Skywalker Says:

    I have no idea about Japanese and Chinese, but your Russian phrase is 100% correct ;)

  2. 2
    Kryvich Says:

    Nick, that’s great. But… Why Delphi _2009_? I think Delphi _2008_ would look better. ;)

  3. 3
    Luigi Sandon Says:

    Why Delphi 2008? It would look "old"… learn from MS and name your software with next year name, it will look the "future" (and it’s already July, even if the release it in a few months it would be almost 2009 already…)

  4. 4
    Craig Stuntz Says:

    Another benefit of installing Asian language support is that it makes your spam e-mail look more interesting. :)

  5. 5
    Russian Says:

    Umm.. Nick, I’m sorry, but won’t you by any chances know/tell us: will the well-known bug with the code editor and international characters be fixed in Tiburon?
    Just few random examples: QC reports #10428, #29791, #35035, #56611. This bug was introduced in D8 and haven’t fixed yet.
    Thanks.
    Sorry if this issue have been already discussed somewhere else.

    P.S.
    I think this is one of most annoying bugs for non-english people. It makes writing programs with international characters in string constants and comments near to impossible. You must write very short line, you can not property works with vertical selection, etc…
    It would be the shame to release 100% unicode application with such bug.

  6. 6
    TOndrej Says:

    I � Unicode :-)
    http://www.codinghorror.com/blog/archives/001084.html

  7. 7
    Lex Y. Li Says:

    Hi Nick, the Chinese translation is also 100% correct.

  8. 8
    Michael Madsen Says:

    Japanese looks right as well (I’m not really an expert on grammar, though, so there might be some subtle detail I’m missing).

    Though Nick doesn’t mention it, this option isn’t found on Vista, since the fonts installed by it are always pre-installed. (Just saying it in case someone goes looking for it ahead of time.)

  9. 9
    Kryvich Says:

    Luigi Sandon -

    I just hope that the release will take place earlier this year, not in November or December.

    Russian -

    I already mentioned this error here
    http://blogs.codegear.com/nickhodges/2008/07/15/39066
    I think, a cause of this error is a wrong interpretation of length of UTF8 strings somewhere in IDE: length(UTF8String) Size(UTF8String).

  10. 10
    Kryvich Says:

    length(UTF8String) _not_equal_ Size(UTF8String)

  11. 11
    CNemo Says:

    It’s a shame that not all Vista versions will allow to instal language packs…

  12. 12
    Seppy Bloom » Tiburón Preview Says:

    [...] - String Theory  Here Comes Tiburon Don’t Get Caught with Boxes Tiburon’s LoadFromFile and SaveToFile for Unicode [...]

  13. 13
    warren Says:

    I agree. If it ships between now and December 2008, it should be called Delphi 2009. And if it ships on or after Jan 1, 2009, it should be Delphi 2010. :-)

    Warren

  14. 14
    Kryvich Says:

    Warren -

    I think they decided to skip Delphi 2008 because digit 8 has bad aura (Delphi 8) :)

  15. 15
    Kryvich Says:

    whoops… Delphi 8

  16. 16
    Jan Wicher Says:

    "you’ll need to use a font in the IDE that actually supports the fully Unicode codepage for the language in question"

    I think that is exactly the problem that is solved by Supplemental language support. A part of the installation is the Uniscribe library which does font substitution. When the IDE uses TextOutW and the like, there is no need to select a specific font. Ranges of characters that are not supported by the selected font, will be rendered with an alternative font. Transparently, by the OS, because TextOutW etc are Uniscribe aware functions. To my knowledge Courier New does not contain CJK. But it does contain Cyrillic and therefore displayed the Russian text correct before the installation.

  17. 17
    Nsgtao Says:

    Yes,Chinese is Correct

  18. 18
    William Says:

    nice

  19. 19
    Sip from the Firehose : Delphi 2009 and C++Builder 2009 Live Webinars with David I starting tomorrow, August 13 Says:

    [...] Don’t Get Caught with Boxes   http://blogs.codegear.com/nickhodges/2008/07/17/39073 [...]

Leave a Reply

© 2009 Nick Hodges | Entries (RSS) and Comments (RSS)

Your Index Web Directorywordpress logo
Close