Permalink
Browse files

Set $KCODE to UTF-8 on Ruby 1.8 to mimic Rails 3 behavior

  • Loading branch information...
1 parent 2f21522 commit cd4efd2e0d862c22d95cf911719ee1d304b0a848 @meineerde meineerde committed Jun 14, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 config/environment.rb
View
@@ -24,9 +24,12 @@
# 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

0 comments on commit cd4efd2

Please sign in to comment.