summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-03 11:38:55 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-03 11:38:55 +0000
commitb67cbf5c6737ecb6774751edf13c37eaa33ee894 (patch)
treebb4557e556fd6e7dda0cf4609677aa270f09ab57
parent422dd55bdb980145cbbb97da8f23defdf7e872d1 (diff)
merging r22085 needs r20086. [ruby-dev:38067]
merges r22086 from trunk into ruby_1_9_1. * ruby.c (process_options): set initial default_external before -r. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@22729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ruby.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a4c6ea24..eb480282c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Feb 6 12:11:24 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ruby.c (process_options): set initial default_external before -r.
+
Sun Feb 22 10:43:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_eval.c (method_missing): should not pop cfp if missing method
diff --git a/ruby.c b/ruby.c
index 3d405f228..3392c7468 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1289,6 +1289,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));