From: Brian Candler Date: 2009-02-16T18:50:36+09:00 Subject: Re: invalid byte sequence in US-ASCII (ArgumentError) Brian Candler wrote: > Yes. IMO this is a horrendous misfeature of ruby 1.9: it asserts that > all external data is text, unless explicitly told otherwise. And worse: the encoding chosen comes from the environment. So your program which you developed on one system and runs correctly there may fail totally on another. I'm not saying that Ruby shouldn't handling encodings and conversions; I'm just saying you should ask for them. For example: File.open("....", :encoding => "UTF-8") # Use this encoding File.open("....", :encoding => "ENV") # Follow the environment File.open("....") # No idea, treat as binary I'm not going to use 1.9 without wrapper scripts to invoke Ruby with appropriate flags to force the external encoding to a fixed value. And that's a pain. -- Posted via http://www.ruby-forum.com/.