If I use Notepad2's menu to set the encoding to "UTF8 with signature", and run 
either "ruby utf8_with_signature.rb" or "ruby -Ku utf8_with_signature.rb", the 
file fails to parse. The file is attached.

If I save the file with encoding set just as "UTF8", the file is 3 bytes 
smaller. "ruby utf8.rb" fails, but "ruby -Ku utf8.rb" works. With "-Ku", things 
work even if I do not have "# -*- coding: utf-8 -*-" in the file.

The repro files are attached.

From: ironruby-core-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Matthew Wilson
Sent: Friday, February 13, 2009 5:11 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] $KCODE and encodings

On Fri, Feb 13, 2009 at 5:01 PM, Shri Borde 
<shri.bo...@microsoft.com<mailto:shri.bo...@microsoft.com>> wrote:
Ruby 1.8 support for encoding:

*         A comment like "# -*- coding: utf-8 -*-" at the start of the file is 
supposed to determine how to parse a .rb file, but I haven't really figured out 
how to make this work. Non-ansi characters cause an error while loading the 
file.

Did the utf-8 file(s) you tried have a BOM or not?

-Matthew

Attachment: utf8_with_signature.rb
Description: utf8_with_signature.rb

Attachment: utf8.rb
Description: utf8.rb

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

Reply via email to