From: "Iñaki Baz Castillo" Date: 2009-09-02T09:15:34+09:00 Subject: Re: Annoying: cannot write ' user=" Iñaki ' in a Ruby1.9 script El Miércoles, 2 de Septiembre de 2009, brabuhr@gmail.com escribió: > On Tue, Sep 1, 2009 at 7:13 PM, Iñaki Baz Castillo wrote: > > Hi, I'm really annoyed, please try this: > > > > Open a file (in a UTF-8 system as any modern Linux) and write: > > > > script.rb > > -------------------- > > user = "Iñaki" > > puts user > > -------------------- > > > > ~# ruby1.9 script.rb > > => invalid multibyte char (US-ASCII) > > > > How can it be possible? The file "script.rb" is encoded in UTF-8 > > How about: > > # encoding: utf-8 > user = "Iñaki" > puts user Yes, that works... but I cannot figure why is this required. I use a system in UTF-8 so the file is encoded in UTF-8. Also Ruby1.9 seems to work in UTF-8 by default: "abc".encoding => # so...? Thanks for your reply. -- Iñaki Baz Castillo