diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-16 15:25:25 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-16 15:25:25 +0000 |
| commit | 69b20b190e5c1dca1a2d351c4d46c550c45b0610 (patch) | |
| tree | c590d4345b28751356a7ff363dd834f2a42a175d /test/ruby | |
| parent | 260afd3c1a0386b5ac2333f59b5e97a5c24feb49 (diff) | |
| download | ruby-69b20b190e5c1dca1a2d351c4d46c550c45b0610.tar.gz ruby-69b20b190e5c1dca1a2d351c4d46c550c45b0610.tar.xz ruby-69b20b190e5c1dca1a2d351c4d46c550c45b0610.zip | |
* io.c (rb_io_binmode): reset encoding conversion.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_m17n.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index bff284660..eeec26d61 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -678,7 +678,6 @@ EOT def test_getc_invalid3 with_pipe("utf-16le:euc-jp") {|r, w| - w.binmode before1 = "\x42\x30".force_encoding("utf-16le") before2 = "\x44\x30".force_encoding("utf-16le") invalid = "\x00\xd8".force_encoding("utf-16le") @@ -1539,6 +1538,18 @@ EOT } end + def test_binmode3 + with_tmpdir { + src = "\u3042\r\n" + generate_file("t.txt", src) + srcbin = src.dup.force_encoding("ascii-8bit") + open("t.txt", "rt:utf-8:euc-jp") {|f| + f.binmode + assert_str_equal(srcbin, f.read) + } + } + end + def test_invalid_r with_tmpdir { generate_file("t.txt", "a\x80b") |
