From: James Gray Date: 2008-10-24T23:00:27+09:00 Subject: [ruby-core:19481] Re: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch) On Oct 24, 2008, at 8:06 AM, James Gray wrote: > I work on TextMate and we use Ruby all over the place inside that > application. I'm sure we have hundreds of scripts in there. We try > hard to make sure everything in TextMate is UTF-8, so now we get > errors out of Ruby 1.9. To fix, we need to add hundreds of magic > comments and worse, train our users who often write their own > automations in Ruby why they have to do the same to make their code > work. The real issue here is that you can argue the user doesn't even know the proper encoding these scripts should be using. Only TextMate really knows the encoding it's going to hand-off the data in. Given that, would it be possible to support an environment variable like RUBY_SCRIPT_ENCODING for these special cases? TextMate could set that before the hand-off, since it knows the environment it's running the scripts under best. Obviously, this would only affect the default script encoding and a magic comment would still override this value. James Edward Gray II