A lot of the work in 1.9 and 2.0 has gone to better unicode support. Most 
string handling functions are now codepoint aware, and there is now the ability 
for the source file to have an encoding attached to it.

Like Curt said, these are in flex, but they are spec'd in RubySpec, so they are 
more than just fleeting ideas.

If you are able to solve this with an extension method, then it looks likely 
that any VS integration work for IRb will take care of that. As it is, I use 
GVim for most of my Ruby coding these days. :)

JD

-----Original Message-----
From: Ted Milker <[EMAIL PROTECTED]>
Sent: October 26, 2008 12:08 PM
To: ironruby-core@rubyforge.org <ironruby-core@rubyforge.org>
Subject: Re: [Ironruby-core] Unicode Source Files


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

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to