mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* regenc.c (onigenc_minimum_property_name_to_ctype):
\p{...} should be case insensitive. [ruby-core:33000] * regenc.c (onigenc_property_list_add_property): ditto. * enc/euc_jp.c (init_property_list, property_name_to_ctype): to lowercase property names. * enc/shift_jis.c (init_property_list, property_name_to_ctype): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63b0601792
commit
dbf7e6f9f2
5 changed files with 43 additions and 9 deletions
|
@ -283,8 +283,8 @@ init_property_list(void)
|
|||
{
|
||||
int r;
|
||||
|
||||
PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);
|
||||
PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);
|
||||
PROPERTY_LIST_ADD_PROP("hiragana", CR_Hiragana);
|
||||
PROPERTY_LIST_ADD_PROP("katakana", CR_Katakana);
|
||||
PropertyInited = 1;
|
||||
|
||||
end:
|
||||
|
@ -295,11 +295,17 @@ static int
|
|||
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
|
||||
{
|
||||
hash_data_type ctype;
|
||||
UChar *s, *e;
|
||||
|
||||
PROPERTY_LIST_INIT_CHECK;
|
||||
|
||||
if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {
|
||||
return onigenc_minimum_property_name_to_ctype(enc, p, end);
|
||||
s = e = ALLOC_N(UChar, end-p+1);
|
||||
for (; p < end; p++) {
|
||||
*e++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
|
||||
}
|
||||
|
||||
if (onig_st_lookup_strend(PropertyNameTable, s, e, &ctype) == 0) {
|
||||
return onigenc_minimum_property_name_to_ctype(enc, s, e);
|
||||
}
|
||||
|
||||
return (int)ctype;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue