aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index e11f236870..cee50a34e8 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1737,6 +1737,11 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
VALUE path = Qnil;
if (!opt->e_script && strcmp(opt->script, "-")) {
path = rb_realpath_internal(Qnil, script_name, 1);
+#if UTF8_PATH
+ if (uenc != lenc) {
+ path = str_conv_enc(path, uenc, lenc);
+ }
+#endif
}
base_block = toplevel_context(toplevel_binding);
iseq = rb_iseq_new_main(tree, opt->script_name, path, vm_block_iseq(base_block));