mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (proc_options): encoding libraries cannot be loaded until
load path is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9615084012
commit
9eab65b3f0
2 changed files with 12 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jan 15 16:59:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ruby.c (proc_options): encoding libraries cannot be loaded until
|
||||
load path is set.
|
||||
|
||||
Tue Jan 15 15:09:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/setup.mak: strip out empty lines from CPP output.
|
||||
|
|
15
ruby.c
15
ruby.c
|
@ -707,24 +707,23 @@ proc_options(int argc, char **argv, struct cmdline_options *opt)
|
|||
|
||||
case 'K':
|
||||
if (*++s) {
|
||||
rb_encoding *enc = 0;
|
||||
const char *enc_name = 0;
|
||||
switch (*s) {
|
||||
case 'E': case 'e':
|
||||
enc = rb_enc_find("EUC-JP");
|
||||
enc_name = "EUC-JP";
|
||||
break;
|
||||
case 'S': case 's':
|
||||
enc = rb_enc_find("Windows-31J");
|
||||
if (!enc) enc = rb_enc_find("Shift_JIS");
|
||||
enc_name = "Windows-31J";
|
||||
break;
|
||||
case 'U': case 'u':
|
||||
enc = ONIG_ENCODING_UTF8;
|
||||
enc_name = "UTF-8";
|
||||
break;
|
||||
case 'N': case 'n': case 'A': case 'a':
|
||||
enc = ONIG_ENCODING_ASCII;
|
||||
enc_name = "US-ASCII";
|
||||
break;
|
||||
}
|
||||
if (enc) {
|
||||
opt->enc_name = rb_str_new2(rb_enc_name(enc));
|
||||
if (enc_name) {
|
||||
opt->enc_name = rb_str_new2(enc_name);
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue