mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c5d9a3cc3a
commit
6eef0808a5
1 changed files with 4 additions and 0 deletions
|
@ -1473,6 +1473,10 @@ EOT
|
|||
content = File.read("iso-2022-jp.txt", :mode=>"rb:ascii-8bit")
|
||||
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)
|
||||
|
||||
open("eucjp.txt", "w:euc-jp:utf-8", xml: :attr) {|f|
|
||||
f.print "\u4E02" # U+4E02 is 0x3021 in JIS X 0212
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue