Displaying special characters (li ke é)

Hi wx guru’s,

When I want to display strings with special characters like é (e + /) in
a
wxRuby gui element, only an empty string is displayed. Not only the
‘special’ characters are hidden but all characters!
I am using wxRuby on windows XP. It doesn’t matter if I include the
special
characters directly in the Ruby source code, or read them from an
external
file (with IO.open).

If you have any suggestions how to fix this problem, it would be greatly
appreciated!

Kind regard,

Daniël

Hi Daniel

Daniel Doorduin wrote:

When I want to display strings with special characters like é (e + /)
in a wxRuby gui element, only an empty string is displayed. Not only
the ‘special’ characters are hidden but all characters!
I am using wxRuby on windows XP. It doesn’t matter if I include the
special characters directly in the Ruby source code, or read them from
an external file (with IO.open).
To display non-ASCII eg accented characters, you need to ensure that the
string to be displayed is in UTF-8 encoding. wxRuby uses UTF-8
internally, so a single application can display characters in any
language for which the user has fonts installed.

I suggest you take a look at the sample text/unicode.rb which shows both
how to display accented latin and non-Latin characters, and also how to
use ruby’s iconv to convert to and from UTF-8.

hth
alex