diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-09-13 04:43:41 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-09-13 04:43:41 -0700 |
commit | 91ffddca57d754f024b90d981acb146a5e9f5ab9 (patch) | |
tree | cf9c165538516314ad2544553adee1bcad9b6f40 /activesupport | |
parent | dbe9fa03dfce54eb2b27341eed924b95e6afbdea (diff) | |
download | rails-91ffddca57d754f024b90d981acb146a5e9f5ab9.tar.gz rails-91ffddca57d754f024b90d981acb146a5e9f5ab9.tar.bz2 rails-91ffddca57d754f024b90d981acb146a5e9f5ab9.zip |
Use Encoding.default_external, not _internal
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/multibyte/utils.rb | 4 | ||||
-rw-r--r-- | activesupport/test/multibyte_utils_test.rb | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/multibyte/utils.rb b/activesupport/lib/active_support/multibyte/utils.rb index a7e40688de..8e47763d39 100644 --- a/activesupport/lib/active_support/multibyte/utils.rb +++ b/activesupport/lib/active_support/multibyte/utils.rb @@ -5,7 +5,7 @@ module ActiveSupport #:nodoc: if Kernel.const_defined?(:Encoding) # Returns a regular expression that matches valid characters in the current encoding def self.valid_character - VALID_CHARACTER[Encoding.default_internal.to_s] + VALID_CHARACTER[Encoding.default_external.to_s] end else def self.valid_character @@ -58,4 +58,4 @@ module ActiveSupport #:nodoc: end end end -end
\ No newline at end of file +end diff --git a/activesupport/test/multibyte_utils_test.rb b/activesupport/test/multibyte_utils_test.rb index d8ac5ff139..dea9e74510 100644 --- a/activesupport/test/multibyte_utils_test.rb +++ b/activesupport/test/multibyte_utils_test.rb @@ -103,11 +103,11 @@ class MultibyteUtilsTest < ActiveSupport::TestCase if Kernel.const_defined?(:Encoding) def example(key) - STRINGS[key].force_encoding(Encoding.default_internal) + STRINGS[key].force_encoding(Encoding.default_external) end def examples - STRINGS.values.map { |s| s.force_encoding(Encoding.default_internal) } + STRINGS.values.map { |s| s.force_encoding(Encoding.default_external) } end else def example(key) @@ -121,21 +121,21 @@ class MultibyteUtilsTest < ActiveSupport::TestCase if 'string'.respond_to?(:encoding) def with_encoding(enc) - before = Encoding.default_internal + before = Encoding.default_external case enc when 'UTF8' - Encoding.default_internal = Encoding::UTF_8 + Encoding.default_external = Encoding::UTF_8 when 'SJIS' - Encoding.default_internal = Encoding::Shift_JIS + Encoding.default_external = Encoding::Shift_JIS else - Encoding.default_internal = Encoding::BINARY + Encoding.default_external = Encoding::BINARY end yield - Encoding.default_internal = before + Encoding.default_external = before end else alias with_encoding with_kcode end -end
\ No newline at end of file +end |