diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-06 03:12:09 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-06 03:12:09 +0000 |
| commit | 2e3b9f86c31e64d670d49766a6ae432f89aabffb (patch) | |
| tree | dfb34b27b7f3412f252a866b54929c4cba5b7b50 | |
| parent | 3cc0d684e989fcf1309688dc864eea22104b5feb (diff) | |
| download | ruby-2e3b9f86c31e64d670d49766a6ae432f89aabffb.tar.gz ruby-2e3b9f86c31e64d670d49766a6ae432f89aabffb.tar.xz ruby-2e3b9f86c31e64d670d49766a6ae432f89aabffb.zip | |
* ruby.c (process_options): set initial default_external before -r.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | ruby.c | 7 |
2 files changed, 11 insertions, 0 deletions
@@ -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. + Fri Feb 6 12:03:47 2009 NAKAMURA Usaku <usa@ruby-lang.org> * ruby.c (process_options): -K and -E in shebang should be reflect to @@ -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)); |
