summaryrefslogtreecommitdiff
path: root/test/ruby/test_transcode.rb
diff options
context:
space:
mode:
authorMartin Dürst <duerst@it.aoyama.ac.jp>2021-07-01 17:33:43 +0900
committerMartin Dürst <duerst@it.aoyama.ac.jp>2021-07-01 17:33:43 +0900
commitf6539202c52a051a4e6946a318a1d9cd29002990 (patch)
tree6d5666150135f9da36971aea47372795ba2f6d87 /test/ruby/test_transcode.rb
parent9ca30516605e4fb3aaaaa268a6542635736ba1e4 (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.rb3
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('"&lt;&quot;&gt;"', 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( "&lt;&gt;\u6E7F", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:text).encode("UTF-8"))
+ assert_equal("\"&lt;&gt;\u6E7F\"", "<>\u6E7F".encode("ISO-2022-JP").encode("ISO-2022-JP", :xml=>:attr).encode("UTF-8"))
end
def test_ascii_range