ruby-changes:10532
From: usa <ko1@a...>
Date: Fri, 6 Feb 2009 12:12:20 +0900 (JST)
Subject: [ruby-changes:10532] Ruby:r22086 (trunk): * ruby.c (process_options): set initial default_external before -r.
usa 2009-02-06 12:12:09 +0900 (Fri, 06 Feb 2009) New Revision: 22086 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22086 Log: * ruby.c (process_options): set initial default_external before -r. Modified files: trunk/ChangeLog trunk/ruby.c Index: ChangeLog =================================================================== --- ChangeLog (revision 22085) +++ ChangeLog (revision 22086) @@ -1,3 +1,7 @@ +Fri Feb 6 12:11:24 2009 NAKAMURA Usaku <usa@r...> + + * ruby.c (process_options): set initial default_external before -r. + Fri Feb 6 12:03:47 2009 NAKAMURA Usaku <usa@r...> * ruby.c (process_options): -K and -E in shebang should be reflect to Index: ruby.c =================================================================== --- ruby.c (revision 22085) +++ ruby.c (revision 22086) @@ -1296,6 +1296,13 @@ opt->src.enc.index = opt_enc_index(opt->src.enc.name); src_encoding_index = opt->src.enc.index; } + if (opt->ext.enc.index >= 0) { + enc = rb_enc_from_index(opt->ext.enc.index); + } + else { + enc = lenc; + } + rb_enc_set_default_external(rb_enc_from_encoding(enc)); if (opt->intern.enc.index >= 0) { enc = rb_enc_from_index(opt->intern.enc.index); rb_enc_set_default_internal(rb_enc_from_encoding(enc)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/