diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 07:37:02 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 07:37:02 +0000 |
commit | 00499c097f0d62a0389d006b61d766cef0ba14ff (patch) | |
tree | 596ab8dc5d853ae3bb204b8ac539e247d337d574 /io.c | |
parent | bc70ea70cd455261d185ec386e4c04ce9ccabf62 (diff) |
Set encodings of stdio after setting default internal and external.
* io.c (rb_stdio_set_default_encoding): added.
* ruby.c (process_options): call rb_stdio_set_default_encoding
after setting defualt internal and external.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -8407,6 +8407,17 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io) return io; } +void +rb_stdio_set_default_encoding() +{ + extern VALUE rb_stdin, rb_stdout, rb_stderr; + VALUE val = Qnil; + + rb_io_set_encoding(1, &val, rb_stdin); + rb_io_set_encoding(1, &val, rb_stdout); + rb_io_set_encoding(1, &val, rb_stderr); +} + static VALUE argf_external_encoding(VALUE argf) { |