diff options
author | Michael Koziarski <michael@koziarski.com> | 2006-10-04 09:03:57 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2006-10-04 09:03:57 +0000 |
commit | e89919082624effcd70208eb58c4e2d90b57a2a9 (patch) | |
tree | 7117b6a06dd10a05c9c37c323ce6ce161590c267 /activesupport/test/multibyte_handler_test.rb | |
parent | f238d495b70a264abdb864fe8107e02766b285b4 (diff) | |
download | rails-e89919082624effcd70208eb58c4e2d90b57a2a9.tar.gz rails-e89919082624effcd70208eb58c4e2d90b57a2a9.tar.bz2 rails-e89919082624effcd70208eb58c4e2d90b57a2a9.zip |
Pull in latest multibyte patch. Closes #6346 [Manfred Stienstra]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/multibyte_handler_test.rb')
-rw-r--r-- | activesupport/test/multibyte_handler_test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activesupport/test/multibyte_handler_test.rb b/activesupport/test/multibyte_handler_test.rb index 08291c1212..7de3c0001e 100644 --- a/activesupport/test/multibyte_handler_test.rb +++ b/activesupport/test/multibyte_handler_test.rb @@ -224,9 +224,17 @@ module UTF8HandlingTest end def test_tidy_bytes - assert_equal "\010", @handler.tidy_bytes(@bytestring) - assert_equal "a\010a", @handler.tidy_bytes('a' + @bytestring + 'a') + result = [0xb8, 0x17e, 0x8, 0x2c6, 0xa5].pack('U*') + assert_equal result, @handler.tidy_bytes(@bytestring) + assert_equal "a#{result}a", @handler.tidy_bytes('a' + @bytestring + 'a') assert_nothing_raised { @handler.tidy_bytes(@bytestring).unpack('U*') } + + assert_equal "\xC3\xA7", @handler.tidy_bytes("\xE7") # iso_8859_1: small c cedilla + assert_equal "\xC2\xA9", @handler.tidy_bytes("\xA9") # iso_8859_1: copyright symbol + assert_equal "\xE2\x80\x9C", @handler.tidy_bytes("\x93") # win_1252: left smart quote + assert_equal "\xE2\x82\xAC", @handler.tidy_bytes("\x80") # win_1252: euro + assert_equal "\x00", @handler.tidy_bytes("\x00") # null char + assert_equal [0xef, 0xbf, 0xbd].pack('U*'), @handler.tidy_bytes("\xef\xbf\xbd") # invalid char end protected |