[Ironruby-core] Unicode Source Files

Curt Hagenlocher curth at microsoft.com
Sun Oct 26 16:31:29 EDT 2008

If you save in "Western European (Windows) - Codepage 1252" from within Visual Studio, you'll get the right result -- as long as you're not using any characters with a codepoint greater than 127.  And if you are, you're probably better off anyway expressing this code point as an explicit set of UTF-8 compatible bytes because -- as you've noticed -- Ruby's currently a bit weird in its Unicode support.

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ted Milker
Sent: Sunday, October 26, 2008 11:34 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Unicode Source Files

Why so rigorous?  I understand the need to maintain compatibility but
this effectively eliminates Visual Studio as an editor for .rb files,
without some kind of clunky build mechanism.  I guess I will just use
an extension method to get around the behavior for the time being.

>From the things I have read about Ruby and UTF-8, it seems more like
it is just extremely broken, rather than extremely tricky.  I still
cannot even get pure Ruby stuff in Windows to work properly with
UTF-8, like when using the Shoes toolkit for example.

On Sun, Oct 26, 2008 at 11:52 AM, Curt Hagenlocher <curth at microsoft.com> wrote:
> We do this for compatibility with Ruby 1.8.6, though as you can see, we don't have the error message quite right:
> PS F:\> C:\ruby\bin\ruby.exe x.rb
> x.rb:1: Invalid char `\377' in expression
> x.rb:1: Invalid char `\376' in expression
> :)
> I believe you'll need to save as UTF-8 and then manually strip the BOM in order to use Unicode source files -- hopefully Tomas will tell me if I'm wrong.
> Source encoding for Ruby is extremely tricky, and (from what I can tell) hasn't even yet been finalized for 1.9.x.  We will eventually support whatever the Ruby standards are.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list