mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Initialize UTF-8 encoding first as it is used always now
This commit is contained in:
parent
d83aa3c2f5
commit
afd765f2ee
1 changed files with 3 additions and 3 deletions
6
ruby.c
6
ruby.c
|
@ -1656,7 +1656,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
|||
const rb_iseq_t *iseq;
|
||||
rb_encoding *enc, *lenc;
|
||||
#if UTF8_PATH
|
||||
rb_encoding *uenc, *ienc = 0;
|
||||
rb_encoding *ienc = 0;
|
||||
rb_encoding *const uenc = rb_utf8_encoding();
|
||||
#endif
|
||||
const char *s;
|
||||
char fbuf[MAXPATHLEN];
|
||||
|
@ -1850,8 +1851,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
|||
#endif
|
||||
}
|
||||
script_name = opt->script_name;
|
||||
rb_enc_associate(opt->script_name,
|
||||
IF_UTF8_PATH(uenc = rb_utf8_encoding(), lenc));
|
||||
rb_enc_associate(opt->script_name, IF_UTF8_PATH(uenc, lenc));
|
||||
#if UTF8_PATH
|
||||
if (uenc != lenc) {
|
||||
opt->script_name = str_conv_enc(opt->script_name, uenc, lenc);
|
||||
|
|
Loading…
Add table
Reference in a new issue