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?

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

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:

Gray Soft / Not Found

Great article. Informative and educational. Thank you.

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