diff options
author | Kouhei Sutou <kou@clear-code.com> | 2010-07-17 15:36:40 +0900 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-07-19 14:55:58 -0700 |
commit | a6e95ba55401ddcaf9ef867a080b30c2d07c56ac (patch) | |
tree | 104802aaf818505ec00980ea76c228f46ec70635 /activesupport/test/multibyte_test_helpers.rb | |
parent | e466354edb31f243899051e2119f4ce72bafd5f3 (diff) | |
download | rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.tar.gz rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.tar.bz2 rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.zip |
fix mixed encoding logs can't be logged.
[#4807 state:committed]
Signed-off-by: Kouhei Sutou <kou@cozmixng.org>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test/multibyte_test_helpers.rb')
-rw-r--r-- | activesupport/test/multibyte_test_helpers.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/test/multibyte_test_helpers.rb b/activesupport/test/multibyte_test_helpers.rb index 597f949059..8839b75601 100644 --- a/activesupport/test/multibyte_test_helpers.rb +++ b/activesupport/test/multibyte_test_helpers.rb @@ -4,6 +4,9 @@ module MultibyteTestHelpers UNICODE_STRING = 'こにちわ' ASCII_STRING = 'ohayo' BYTE_STRING = "\270\236\010\210\245" + if BYTE_STRING.respond_to?(:force_encoding) + BYTE_STRING.force_encoding("ASCII-8BIT") + end def chars(str) ActiveSupport::Multibyte::Chars.new(str) @@ -16,4 +19,4 @@ module MultibyteTestHelpers def assert_equal_codepoints(expected, actual, message=nil) assert_equal(inspect_codepoints(expected), inspect_codepoints(actual), message) end -end
\ No newline at end of file +end |