[fxruby-users] Unicode support in FXRuby 1.6

Oliver Smith olivers at mondrian-ide.com
Sat Sep 3 02:05:31 EDT 2005

> > That's all I could get to happen.  So you can store Unicode strings with
> > the '\x' escape code, but you have to type in the UTF or
> Japanese encoded
> > bytes manually (no u'Unicode String' like in Python) and ruby doesn't
> > really know the difference.
> Can't you store the ruby scripts as UTF8 encoded text files? Or
> will the ruby
> interperter struggle with that?

I think there is a way to do that, since there's a -K option to the ruby
interpreter which allows you to specify UTF-8, EUC or Shift-JIS, but when I
tried it choked on the non-ascii character regardless (I just saved a simple
ruby file in UTF-8 format with notepad and did 'ruby -Ku test.rb').  I guess
the $KCODE system variable is supposed to do this also.

I just noticed an argument to Regexp.new which allows you to specify from
the same charset choices.  I can use a UTF-8 two-byte character in a
character class and it works as expected.


More information about the fxruby-users mailing list