[Ironruby-core] Unicode Source Files

Ted Milker tmilker at gmail.com
Sun Oct 26 15:01:06 EDT 2008


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.


More information about the Ironruby-core mailing list