Skip to content

Commit

Permalink
we are *sure* we want to set the encoding, so silence warnings around it
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 24, 2011
1 parent 8184373 commit 3cbc1bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions railties/lib/rails.rb
Expand Up @@ -22,8 +22,10 @@
if RUBY_VERSION < '1.9' if RUBY_VERSION < '1.9'
$KCODE='u' $KCODE='u'
else else
Encoding.default_external = Encoding::UTF_8 silence_warnings do
Encoding.default_internal = Encoding::UTF_8 Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
end end


module Rails module Rails
Expand Down
7 changes: 5 additions & 2 deletions railties/lib/rails/application/configuration.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/string/encoding' require 'active_support/core_ext/string/encoding'
require 'active_support/core_ext/kernel/reporting'
require 'rails/engine/configuration' require 'rails/engine/configuration'


module Rails module Rails
Expand Down Expand Up @@ -53,8 +54,10 @@ def compiled_asset_path
def encoding=(value) def encoding=(value)
@encoding = value @encoding = value
if "ruby".encoding_aware? if "ruby".encoding_aware?
Encoding.default_external = value silence_warnings do
Encoding.default_internal = value Encoding.default_external = value
Encoding.default_internal = value
end
else else
$KCODE = value $KCODE = value
if $KCODE == "NONE" if $KCODE == "NONE"
Expand Down

0 comments on commit 3cbc1bd

Please sign in to comment.