aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 1467fdfb23..f33096b9f0 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1192,8 +1192,8 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
else {
enc = rb_usascii_encoding();
}
- rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc));
tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start);
+ rb_funcall(f, rb_intern("set_encoding"), 1, rb_parser_encoding(parser));
if (script && rb_parser_end_seen_p(parser)) {
rb_define_global_const("DATA", f);
}