[Ironruby-core] Unicode Source Files

Jim Deville jdeville at microsoft.com
Sun Oct 26 16:17:40 EDT 2008

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. :)


-----Original Message-----
From: Ted Milker <tmilker at gmail.com>
Sent: October 26, 2008 12:08 PM
To: ironruby-core at rubyforge.org <ironruby-core at 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 at rubyforge.org

More information about the Ironruby-core mailing list