Permalink
Browse files

we are *sure* we want to set the encoding, so silence warnings around it

  • Loading branch information...
1 parent 8184373 commit 3cbc1bd395c4f6699dd4d8384b85c0d214a12c81 @tenderlove tenderlove committed Aug 24, 2011
Showing with 9 additions and 4 deletions.
  1. +4 −2 railties/lib/rails.rb
  2. +5 −2 railties/lib/rails/application/configuration.rb
View
@@ -22,8 +22,10 @@
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
@@ -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 @@ def compiled_asset_path
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"

0 comments on commit 3cbc1bd

Please sign in to comment.