diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-20 16:57:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-20 16:57:19 +0000 |
commit | e50a5bcef093f814ebd8d162a3c2f3665620e412 (patch) | |
tree | c416336a18a6390642bbfa72b9d0aecde06e2dc3 /test | |
parent | b5e583f7e39b45c6fbdadafcf8d9dc76ff13eefc (diff) | |
download | ruby-e50a5bcef093f814ebd8d162a3c2f3665620e412.tar.gz |
* io.c (rb_io_extract_modeenc): plain rb/wb should set ASCII-8BIT
to the external_encoding.
* io.c (rb_file_open_internal): ditto.
* io.c (NEED_WRITECONV): no conversion when the external_encoding
is ASCII-8BIT.
* io.c (do_writeconv): skip ASCII-8BIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 6d3589580e..8b7c3363d1 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -59,7 +59,7 @@ EOT with_tmpdir { generate_file('tmp', "") open("tmp", "rb") {|f| - assert_equal(Encoding.default_external, f.external_encoding) + assert_equal(Encoding.find("ASCII-8BIT"), f.external_encoding) assert_equal(nil, f.internal_encoding) } } @@ -137,7 +137,7 @@ EOT def test_open_wb with_tmpdir { open("tmp", "wb") {|f| - assert_equal(nil, f.external_encoding) + assert_equal(Encoding.find("ASCII-8BIT"), f.external_encoding) assert_equal(nil, f.internal_encoding) } } @@ -1314,7 +1314,7 @@ EOT # 0xA1F1 0xC2A2 U+00A2 open("t","rt") {|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding(Encoding.default_external), f.read) } - open("t","rb") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding(Encoding.default_external), f.read) } + open("t","rb") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding(Encoding::ASCII_8BIT), f.read) } open("t","rt:euc-jp") {|f| assert_equal("a\nb\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) } open("t","rb:euc-jp") {|f| assert_equal("a\rb\r\nc\n\xc2\xa2".force_encoding("EUC-JP"), f.read) } |