aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c7
1 files changed, 7 insertions, 0 deletions
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));