diff options
| -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 |
