All strings you pass to GTK+ functions must be in UTF-8. Of course, Ruby-GNOME2 has the same requirement.
Usually, you have written ruby scripts in your locale and charset, which isn't necessarily UTF-8.
So you may be confused about how to write texts in Ruby-GNOME2 at first.
Here is a summary of your options:
This is the easiest way if you use an editor that supports UTF-8.
You need to define $KCODE = 'u' in the head of your script.
$KCODE = 'u' require 'gtk2' ...
Also you can use the -K option to Ruby.
Write your script with your favorite editor which doesn't support UTF-8. You save it with your own (non-UTF-8) charset.
Then you convert it with iconv when you run it.
iconv -f <your charset> -t utf-8 foo.rb |ruby - iconv -f euc-jp -t utf-8 foo.rb |ruby -
Effectively, this is the same as the first method. So you need to define $KCODE = 'u' in your script.
3 Use GLib.convert for each string.
GLib.convert converts a string from one character set to another.
require 'gtk2' Gtk::Button.new(GLib.convert("RYOUKAI", "utf-8", "euc-jp")) #str, to, from
I don't recommand this way for static texts. Usually you should use GLib.convert when you read non-ascii, non-utf-8 texts from files or networks.
So far, they don't support i18n (L10n). It may be no problem if you distribute your scripts locally. But if you want to distribute it whole the world, you need to support i18n (L10n).
Ruby-GetText-Package is the one of the solutions which automates replacing English text with localized text. It's also compatible with the GNU gettext Package. Try it if you are interested.