diff options
author | Martin Dürst <[email protected]> | 2021-07-01 17:33:43 +0900 |
---|---|---|
committer | Martin Dürst <[email protected]> | 2021-07-01 17:33:43 +0900 |
commit | f6539202c52a051a4e6946a318a1d9cd29002990 (patch) | |
tree | 6d5666150135f9da36971aea47372795ba2f6d87 /test/ruby/test_transcode.rb | |
parent | 9ca30516605e4fb3aaaaa268a6542635736ba1e4 (diff) |
- add regression tests for U+6E7F (湿) in ISO-2022-JP
In ISO-2022-JP, the bytes use to code are the same as those for "<>".
This adds regression tests to make sure that these bytes, when representing
湿, are NOT escaped with encode("ISO-2022-JP, xml: :text) or similar.
These are additional regression tests for #12052.
Diffstat (limited to 'test/ruby/test_transcode.rb')
-rw-r--r-- | test/ruby/test_transcode.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 17384fd0c7..c8b0034e06 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -143,6 +143,9 @@ class TestTranscode < Test::Unit::TestCase assert_equal('"<">"', escaped.encode('UTF-8'), "failed encoding #{src_enc} to #{dst_enc} with xml: :attr") end end + # regression test; U+6E7F (湿) uses the same bytes in ISO-2022-JP as "<>" + assert_equal( "<>\u6E7F", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:text).encode("UTF-8")) + assert_equal("\"<>\u6E7F\"", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:attr).encode("UTF-8")) end def test_ascii_range |