On Fri, Mar 27, 2009 at 8:05 AM, Damjan Rems <d_rems / yahoo.com> wrote:
>
> I am trying some ruby 1.9. taste for the first time and I have got to
> this new behaviour. Since my location is in Estern Europe, most of my
> source files are coded in utf-8. I have found out that I should use #
> coding: utf-8 if I want to omit nasty "rubyArchiveTesti.rb:82: invalid
> multibyte char (US-ASCII)" error.
>
> Where can I set that all my source files are encoded in utf-8, since I
> don't like the idea of editing them all.

-Ku does this but it's not recommendable.  If your code needs to run
on any other computers, it would need to be run with this flag.
The source encoding magic comments are just a reality of Ruby 1.9
based development, and it seems that your problem could be solved by
better settings in your editor to automatically add this line for you.

-greg

foo.rb:

p __ENCODING__

$ ruby19 foo.rb
#<Encoding:US-ASCII>
 $ ruby19 -Ku foo.rb
#<Encoding:UTF-8>


-greg


-- 
Technical Blaag at: http://blog.majesticseacreature.com
 Non-tech stuff at: http://metametta.blogspot.com
"Ruby Best Practices"  Book now in O'Reilly Roughcuts:
http://rubybestpractices.com