ruby-changes:12744
From: yugui <ko1@a...>
Date: Sun, 9 Aug 2009 15:51:32 +0900 (JST)
Subject: [ruby-changes:12744] Ruby:r24456 (ruby_1_9_1): merges r24337 from trunk into ruby_1_9_1.
yugui 2009-08-09 00:31:15 +0900 (Sun, 09 Aug 2009) New Revision: 24456 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24456 Log: 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. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/io.c branches/ruby_1_9_1/ruby.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 24455) +++ ruby_1_9_1/ChangeLog (revision 24456) @@ -1,3 +1,10 @@ +Fri Jul 31 16:28:33 2009 NARUSE, Yui <naruse@r...> + + * 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@r...> * lib/securerandom.rb (SecureRandom.random_bytes): return string should Index: ruby_1_9_1/io.c =================================================================== --- ruby_1_9_1/io.c (revision 24455) +++ ruby_1_9_1/io.c (revision 24456) @@ -7948,6 +7948,17 @@ 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) { Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 24455) +++ ruby_1_9_1/version.h (revision 24456) @@ -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 Index: ruby_1_9_1/ruby.c =================================================================== --- ruby_1_9_1/ruby.c (revision 24455) +++ ruby_1_9_1/ruby.c (revision 24456) @@ -1370,6 +1370,7 @@ else if (!rb_default_internal_encoding()) /* Freeze default_internal */ rb_enc_set_default_internal(Qnil); + rb_stdio_set_default_encoding(); if (!tree) return Qfalse; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/