diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 07:53:43 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 07:53:43 +0000 |
commit | 78f540019a394421e1875cacaf956e8c23b18cc0 (patch) | |
tree | 9b1e1d75453aa54f7cde6ec5a31b51c4eec56460 /enc/unicode.c | |
parent | 49f25a1299e04d3423351ab9bc212b8cdd6547a3 (diff) |
* enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6
special cases in CaseUnfold_11_Table.
* enc/unicode.c: Adjustments for above.
* test/ruby/enc/test_case_mapping.rb: Tests for the above: Some tests in
test_titlecase activated; test_greek added. A test in test_cherokee fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
-rw-r--r-- | enc/unicode.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/enc/unicode.c b/enc/unicode.c index 87ebb0d8a8..eebf060dd9 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -750,12 +750,17 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, } } else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0) { /* data about character found in CaseUnfold_11_Table */ - if (flags&OnigCaseFoldFlags(folded->n)) { - int count = OnigCodePointCount(folded->n); - const OnigCodePoint *next = folded->code; + if (flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */ MODIFIED; - if (count==1) - code = *next; + if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) + code = folded->code[1]; + else + code = folded->code[0]; + } + else if ((flags&(ONIGENC_CASE_UPCASE)) + && (code==0x03B9||code==0x03BC)) { /* GREEK SMALL LETTERs IOTA/MU */ + MODIFIED; + code = folded->code[1]; } } } |