зеркало из https://github.com/github/ruby.git
re.c: use built-in encoding indexes
* internal.h: add EUC-JP and Windows-31J. * re.c (rb_char_to_option_kcode): use built-in encoding indexes in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
14dfdb5eaf
Коммит
58919a4da9
|
@ -1,4 +1,9 @@
|
|||
Tue Jul 2 17:22:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Tue Jul 2 17:22:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* internal.h: add EUC-JP and Windows-31J.
|
||||
|
||||
* re.c (rb_char_to_option_kcode): use built-in encoding indexes in
|
||||
internal.h.
|
||||
|
||||
* internal.h: add UTF8-MAC.
|
||||
|
||||
|
|
|
@ -566,6 +566,9 @@ rb_enc_init(void)
|
|||
ENCDB_REGISTER("UTF-16", UTF_16);
|
||||
ENCDB_REGISTER("UTF-32", UTF_32);
|
||||
ENCDB_REGISTER("UTF8-MAC", UTF8_MAC);
|
||||
|
||||
ENCDB_REGISTER("EUC-JP", EUC_JP);
|
||||
ENCDB_REGISTER("Windows-31J", Windows_31J);
|
||||
#undef ENCDB_REGISTER
|
||||
#endif
|
||||
enc_table.count = ENCINDEX_BUILTIN_MAX;
|
||||
|
|
|
@ -211,6 +211,10 @@ enum ruby_preserved_encindex {
|
|||
ENCINDEX_UTF_16,
|
||||
ENCINDEX_UTF_32,
|
||||
ENCINDEX_UTF8_MAC,
|
||||
|
||||
/* for old options of regexp */
|
||||
ENCINDEX_EUC_JP,
|
||||
ENCINDEX_Windows_31J,
|
||||
#endif
|
||||
|
||||
ENCINDEX_BUILTIN_MAX
|
||||
|
|
4
re.c
4
re.c
|
@ -307,10 +307,10 @@ rb_char_to_option_kcode(int c, int *option, int *kcode)
|
|||
*kcode = rb_ascii8bit_encindex();
|
||||
return (*option = ARG_ENCODING_NONE);
|
||||
case 'e':
|
||||
*kcode = rb_enc_find_index("EUC-JP");
|
||||
*kcode = ENCINDEX_EUC_JP;
|
||||
break;
|
||||
case 's':
|
||||
*kcode = rb_enc_find_index("Windows-31J");
|
||||
*kcode = ENCINDEX_Windows_31J;
|
||||
break;
|
||||
case 'u':
|
||||
*kcode = rb_utf8_encindex();
|
||||
|
|
Загрузка…
Ссылка в новой задаче