diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-09 07:36:33 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-09 07:36:33 +0000 |
commit | dbf7e6f9f232a3173b118c5f1ad57f97aa7e4e9d (patch) | |
tree | 028f6f1e772bd43eeb67e4741fb7e3221b137449 /enc/euc_jp.c | |
parent | 63b0601792541615b2ef18c690c167c16593078d (diff) |
* 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
Diffstat (limited to 'enc/euc_jp.c')
-rw-r--r-- | enc/euc_jp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/enc/euc_jp.c b/enc/euc_jp.c index d4a9f57866..3b339f9600 100644 --- a/enc/euc_jp.c +++ b/enc/euc_jp.c @@ -274,8 +274,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: @@ -286,11 +286,17 @@ static int property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end) { st_data_t 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 ctype; |