mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
- 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.
This commit is contained in:
parent
9ca3051660
commit
f6539202c5
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue