From 03c7332241e8f85b2a1d87dd88ed2946c9d32060 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 6 Feb 2009 03:12:09 +0000 Subject: [PATCH] * ruby.c (process_options): set initial default_external before -r. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ruby.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index e53c2b4724..b075a0d59c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Feb 6 12:11:24 2009 NAKAMURA Usaku + + * ruby.c (process_options): set initial default_external before -r. + Fri Feb 6 12:03:47 2009 NAKAMURA Usaku * ruby.c (process_options): -K and -E in shebang should be reflect to diff --git a/ruby.c b/ruby.c index 16cf652b5e..3821b939d8 100644 --- a/ruby.c +++ b/ruby.c @@ -1296,6 +1296,13 @@ process_options(VALUE arg) 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));