Here is the extension method I am using if anyone else is interested:

public static object ExecuteUnicodeFile( this ScriptRuntime rt, string
filename )
{
    string rbCode;

    // OpenText will strip the BOM and keep the Unicode intact
    using( var rdr = File.OpenText( filename ) )
    {
        rbCode = rdr.ReadToEnd();
    }

    return IronRuby.Ruby.GetEngine( rt ).Execute( rbCode );
}

It works great for using Japanese in strings in Ruby with IronRuby and WPF.
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to