From a91563e194ca80e949434c930d0af78cbdb1f26c Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 14 Jun 2012 11:00:12 +0200 Subject: [PATCH] Set $KCODE to UTF-8 on Ruby 1.8 to mimic Rails 3 behavior --- config/environment.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environment.rb b/config/environment.rb index 84d6d1ff..600597c9 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -24,9 +24,12 @@ ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] if ENV['RACK_ENV'] # Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION +# this is replaced by config.encoding = "utf-8" in rails3 if RUBY_VERSION >= '1.9' Encoding.default_external = 'UTF-8' Encoding.default_internal = 'UTF-8' +else + $KCODE='UTF-8' end # Bootstrap the Rails environment, frameworks, and default configuration