diff options
Diffstat (limited to 'test/ruby/test_econv.rb')
-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 cb902d76f8..c458371ad4 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -36,6 +36,14 @@ class TestEncodingConverter < Test::Unit::TestCase assert_nil(Encoding::Converter.stateless_encoding(Encoding::UTF_8)) end + def test_stateless_encoding_iso2022jp + slenc = Encoding::Converter.stateless_encoding("ISO-2022-JP") + str = "\e$B~~\(B".force_encoding("iso-2022-jp") + str2 = str.encode(slenc) + str3 = str.encode("ISO-2022-JP") + assert_equal(str, str3) + end + def test_new assert_kind_of(Encoding::Converter, Encoding::Converter.new("UTF-8", "EUC-JP")) assert_kind_of(Encoding::Converter, Encoding::Converter.new(Encoding::UTF_8, Encoding::EUC_JP)) |