mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (process_options): encoding set by command line option takes
priority over the encoding in the source, as the primary encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3493a66ec6
commit
4bc9096b23
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Oct 23 10:42:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ruby.c (process_options): encoding set by command line option takes
|
||||||
|
priority over the encoding in the source, as the primary encoding.
|
||||||
|
|
||||||
Mon Oct 22 11:03:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Oct 22 11:03:09 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* encoding.c (enc_check_encoding): returns index now.
|
* encoding.c (enc_check_encoding): returns index now.
|
||||||
|
|
9
ruby.c
9
ruby.c
|
@ -843,6 +843,7 @@ process_options(VALUE arg)
|
||||||
char **argv = opt->argv;
|
char **argv = opt->argv;
|
||||||
NODE *tree = 0;
|
NODE *tree = 0;
|
||||||
VALUE parser;
|
VALUE parser;
|
||||||
|
VALUE encoding;
|
||||||
const char *s;
|
const char *s;
|
||||||
int i = proc_options(argc, argv, opt);
|
int i = proc_options(argc, argv, opt);
|
||||||
|
|
||||||
|
@ -970,7 +971,13 @@ process_options(VALUE arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_set_primary_encoding(rb_parser_encoding(parser));
|
if (opt->enc_index >= 0) {
|
||||||
|
encoding = rb_enc_from_encoding(rb_enc_from_index(opt->enc_index));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
encoding = rb_parser_encoding(parser);
|
||||||
|
}
|
||||||
|
rb_set_primary_encoding(encoding);
|
||||||
|
|
||||||
return (VALUE)tree;
|
return (VALUE)tree;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue