From 6eef0808a5caea71f19ba8d6aaeb85044e746631 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 8 Sep 2008 19:38:11 +0000 Subject: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 57943df25f..ba8d8f00a9 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -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 } -- cgit v1.2.3