From dc98e2528a3d553a6ea7028482df8d5c48582601 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 5 Sep 2008 20:37:36 +0000 Subject: * transcode.c (output_hex_charref): upcase hexadecimal digits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_econv.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 29ae65b5a7..0a774c4a7a 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -684,5 +684,13 @@ class TestEncodingConverter < Test::Unit::TestCase ec.convert("\u{306f 3041 3044 2665 3002}")) assert_equal("\e(B".force_encoding("ISO-2022-JP"), ec.finish) + + ec = Encoding::Converter.new("EUC-JP", "US-ASCII", Encoding::Converter::UNDEF_HEX_CHARREF) + assert_equal("交換法則: n×m=m×n".force_encoding("ISO-8859-1"), + ec.convert("\xB8\xF2\xB4\xB9\xCB\xA1\xC2\xA7: n\xA1\xDFm=m\xA1\xDFn")) + + ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1", Encoding::Converter::UNDEF_HEX_CHARREF) + assert_equal("交換法則: n\xD7m=m\xD7n".force_encoding("ISO-8859-1"), + ec.convert("\xB8\xF2\xB4\xB9\xCB\xA1\xC2\xA7: n\xA1\xDFm=m\xA1\xDFn")) end end -- cgit v1.2.3