diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:31:15 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:31:15 +0000 |
commit | 944148dd91973b4e991b1ba6cd0514e1f055fb31 (patch) | |
tree | 43a3ed2b2326192d804ff6461ad6cb840b091893 | |
parent | a036553eb529cc9317c8d10b377817ae7f4e9df2 (diff) |
merges r24337 from trunk into ruby_1_9_1.
--
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/branches/ruby_1_9_1@24456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | io.c | 11 | ||||
-rw-r--r-- | ruby.c | 1 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Fri Jul 31 16:28:33 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * io.c (rb_stdio_set_default_encoding): added. + + * ruby.c (process_options): call rb_stdio_set_default_encoding + after setting defualt internal and external. + Fri Jul 31 18:01:34 2009 NAKAMURA Usaku <usa@ruby-lang.org> * lib/securerandom.rb (SecureRandom.random_bytes): return string should @@ -7948,6 +7948,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) { @@ -1370,6 +1370,7 @@ process_options(VALUE arg) else if (!rb_default_internal_encoding()) /* Freeze default_internal */ rb_enc_set_default_internal(Qnil); + rb_stdio_set_default_encoding(); if (!tree) return Qfalse; @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 260 +#define RUBY_PATCHLEVEL 261 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |