diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-06-02 10:35:00 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-07-10 09:34:08 -0700 |
commit | ddd9704ae9bf884d867b6f57a16c095a79393fff (patch) | |
tree | 6d4934a98933cd56111d4c17f0c19cff3c4b85ee /test/ruby/test_io_m17n.rb | |
parent | 82489f02429c14f945dbef787308d13adfa0018d (diff) |
Encode ' as ' when using encode(xml: :attr)
Fixes [Bug #16922]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3177
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index e5b0ef0585..7b37893514 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2047,19 +2047,19 @@ EOT with_tmpdir { open("raw.txt", "wb", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" } content = File.read("raw.txt", :mode=>"rb:ascii-8bit") - assert_equal("\"&<>"'\u4E02\u3042\n\"".force_encoding("ascii-8bit"), content) + assert_equal("\"&<>"'\u4E02\u3042\n\"".force_encoding("ascii-8bit"), content) open("ascii.txt", "wb:us-ascii", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" } content = File.read("ascii.txt", :mode=>"rb:ascii-8bit") - assert_equal("\"&<>"'丂あ\n\"".force_encoding("ascii-8bit"), content) + assert_equal("\"&<>"'丂あ\n\"".force_encoding("ascii-8bit"), content) open("iso-2022-jp.txt", "wb:iso-2022-jp", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" } content = File.read("iso-2022-jp.txt", :mode=>"rb:ascii-8bit") - assert_equal("\"&<>"'丂\e$B$\"\e(B\n\"".force_encoding("ascii-8bit"), content) + assert_equal("\"&<>"'丂\e$B$\"\e(B\n\"".force_encoding("ascii-8bit"), content) open("utf-16be.txt", "wb:utf-16be", xml: :attr) {|f| f.print '&<>"\''; f.puts "\u4E02\u3042" } content = File.read("utf-16be.txt", :mode=>"rb:ascii-8bit") - assert_equal("\0\"\0&\0a\0m\0p\0;\0&\0l\0t\0;\0&\0g\0t\0;\0&\0q\0u\0o\0t\0;\0'\x4E\x02\x30\x42\0\n\0\"".force_encoding("ascii-8bit"), content) + assert_equal("\0\"\0&\0a\0m\0p\0;\0&\0l\0t\0;\0&\0g\0t\0;\0&\0q\0u\0o\0t\0;\0&\0a\0p\0o\0s\0;\x4E\x02\x30\x42\0\n\0\"".force_encoding("ascii-8bit"), content) open("eucjp.txt", "w:euc-jp:utf-8", xml: :attr) {|f| f.print "\u4E02" # U+4E02 is 0x3021 in JIS X 0212 |