diff options
author | wycats <wycats@gmail.com> | 2010-05-17 19:41:54 +0400 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-05-17 19:41:54 +0400 |
commit | 80b60671f7216c571ea8711d1de8ca824aefbe54 (patch) | |
tree | c84be59be24bbd978b257ac526eb9b0f9051389f /railties/lib | |
parent | 5371242384171dc0255716e31e9257ddeec17d10 (diff) | |
download | rails-80b60671f7216c571ea8711d1de8ca824aefbe54.tar.gz rails-80b60671f7216c571ea8711d1de8ca824aefbe54.tar.bz2 rails-80b60671f7216c571ea8711d1de8ca824aefbe54.zip |
Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 0611b2a9f5..be486ef2ac 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -23,6 +23,7 @@ if RUBY_VERSION < '1.9' $KCODE='u' else Encoding.default_external = Encoding::UTF_8 + Encoding.default_internal = Encoding::UTF_8 end module Rails diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 9353fbefef..8afe423973 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -1,4 +1,5 @@ require 'active_support/deprecation' +require 'active_support/core_ext/string/encoding' require 'rails/engine/configuration' module Rails @@ -27,8 +28,15 @@ module Rails def encoding=(value) @encoding = value - if defined?(Encoding) && Encoding.respond_to?(:default_external=) + if "ruby".encoding_aware? Encoding.default_external = value + Encoding.default_internal = value + else + $KCODE = value + if $KCODE == "NONE" + raise "The value you specified for config.encoding is " \ + "invalid. The possible values are UTF8, SJIS, or EUC" + end end end |