aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io_m17n.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-12 06:18:11 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-12 06:18:11 +0000
commit0a8f047a983deaf853e8ddc9f70da78f3a83f9ef (patch)
treea81c3aa0c837d42524c6b193cdc717322f1aa591 /test/ruby/test_io_m17n.rb
parente960fffda106cc1689b10fca54f99e7a8555bb6f (diff)
downloadruby-0a8f047a983deaf853e8ddc9f70da78f3a83f9ef.tar.gz
* io.c (rb_io_putc): support multibyte characters.
[ruby-core:30697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 3d3b64c6cc..5f35c227ea 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -1026,6 +1026,16 @@ EOT
}
end
+ def test_open_pipe_r_enc2
+ open("|#{EnvUtil.rubybin} -e 'putc ?\u3042'", "r:UTF-8") {|f|
+ assert_equal(Encoding::UTF_8, f.external_encoding)
+ assert_equal(nil, f.internal_encoding)
+ s = f.read
+ assert_equal(Encoding::UTF_8, s.encoding)
+ assert_equal("\u3042", s)
+ }
+ end
+
def test_s_foreach_enc
with_tmpdir {
generate_file("t", "\xff")