summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--enc/unicode.c17
-rwxr-xr-xenc/unicode/case-folding.rb6
2 files changed, 5 insertions, 18 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index f762763..39fb244 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -768,19 +768,10 @@ 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)) { /* needs and data availability match */
- MODIFIED;
- 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||code==0xA64B)) { /* GREEK SMALL LETTERs IOTA/MU, */
- MODIFIED; /* CYRILLIC SMALL LETTER MONOGRAPH UK */
- code = folded->code[1];
- }
+ else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0 /* data about character found in CaseUnfold_11_Table */
+ && flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */
+ MODIFIED;
+ code = folded->code[(flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) ? 1 : 0];
}
}
to += ONIGENC_CODE_TO_MBC(enc, code, to);
diff --git a/enc/unicode/case-folding.rb b/enc/unicode/case-folding.rb
index aa6c6d5..829efef 100755
--- a/enc/unicode/case-folding.rb
+++ b/enc/unicode/case-folding.rb
@@ -305,11 +305,7 @@ class CaseMapping
when item.upper then flags += '|U'
when item.lower then flags += '|D'
else
- unless from=='03B9' or from=='03BC' or from=='A64B'
- # cf. code==0x03B9||code==0x03BC||code==0xA64B in enc/unicode.c,
- # towards the end of function onigenc_unicode_case_map
- raise "Unpredicted case 0 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/."
- end
+ raise "Unpredicted case 0 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/."
end
unless item.upper == item.title
if item.code == item.title