Where to set utf-8 encoding

Where do I set

Encoding.default_external = ‘UTF-8’

in Rails 2.3.8?

Can I add it to the environment.rb? Where?

On Thu, Feb 3, 2011 at 6:29 PM, Paul B. [email protected]
wrote:

Where do I set

Encoding.default_external = ‘UTF-8’

in Rails 2.3.8?

Can I add it to the environment.rb? Where?

This is probably entirely wrong for what you want, but today I had a
little
adventure with a certain non-ascii character and I found I could set the
encoding at the class level using the following comment at the top of
the
file:

encoding: UTF-8

http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings

I added this to the top of environment.rb

Encoding.default_external = ‘UTF-8’

Seems to have done the trick. At least I think so.

Phillip wrote in post #979611:

http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings

Great article. Informative and educational. Thank you.

On Fri, Feb 4, 2011 at 8:39 AM, Paul B. [email protected]
wrote:

Phillip wrote in post #979611:

http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings

Yeah, I saw that too, unusually clear on a subject that generally makes my
eyes glaze over

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs