diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-24 16:23:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-24 16:23:38 -0700 |
commit | 3096629d297a77a9b64747a0ac2df6b2cbf47a68 (patch) | |
tree | c054f4cafa03e73c2038d455ab76608b6e4ccca9 /railties/lib | |
parent | 5345958b3a39b8675edb7fb27b4adee250d930f7 (diff) | |
download | rails-3096629d297a77a9b64747a0ac2df6b2cbf47a68.tar.gz rails-3096629d297a77a9b64747a0ac2df6b2cbf47a68.tar.bz2 rails-3096629d297a77a9b64747a0ac2df6b2cbf47a68.zip |
we are *sure* we want to set the encoding, so silence warnings around it
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index de412553aa..73bdd0b552 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -22,8 +22,10 @@ require 'action_dispatch/railtie' if RUBY_VERSION < '1.9' $KCODE='u' else - Encoding.default_external = Encoding::UTF_8 - Encoding.default_internal = Encoding::UTF_8 + silence_warnings do + Encoding.default_external = Encoding::UTF_8 + Encoding.default_internal = Encoding::UTF_8 + end end module Rails diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index c4a02ba5c0..00322528b5 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/string/encoding' +require 'active_support/core_ext/kernel/reporting' require 'rails/engine/configuration' module Rails @@ -53,8 +54,10 @@ module Rails def encoding=(value) @encoding = value if "ruby".encoding_aware? - Encoding.default_external = value - Encoding.default_internal = value + silence_warnings do + Encoding.default_external = value + Encoding.default_internal = value + end else $KCODE = value if $KCODE == "NONE" |