diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_econv.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |