I need to change the default ruby string encoding to UTF-8 in Heroku. For some reason it is US-ASCII.
$ heroku console
Ruby console for myapp.heroku.com
>> "a".encoding
=> #<Encoding:ASCII-8BIT>
However, if I run irb locally I get a different result:
$ irb
ruby-1.9.2-p136 :001 > "a".encoding
=> #<Encoding:UTF-8>
Both run on ruby 1.9.2. I've tried setting this as well, but didn't work:
Encoding.default_internal = Encoding.default_external = "UTF-8"
Ideas?
Thanks,
Felipe
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…