ICU-4399 fix simple case folding of U+0130: simple-case-folds to itself because it's not mentioned in CaseFolding.txt

X-SVN-Rev: 17483
This commit is contained in:
Markus Scherer 2005-04-17 00:34:43 +00:00
parent 6c4ccc015e
commit b2df052b12
2 changed files with 14 additions and 12 deletions

View file

@ -647,11 +647,21 @@ public final class UCharacterCaseTest extends TestFmwk
0x003f, 0x003a, 0x006b, 0x006c, 0x6d, 0x006e, 0x006f,
0x01c6, 0x01c9, 0x000c, 0x0000};
/*
* CaseFolding.txt says about i and its cousins:
* 0049; C; 0069; # LATIN CAPITAL LETTER I
* 0049; T; 0131; # LATIN CAPITAL LETTER I
*
* 0130; F; 0069 0307; # LATIN CAPITAL LETTER I WITH DOT ABOVE
* 0130; T; 0069; # LATIN CAPITAL LETTER I WITH DOT ABOVE
* That's all.
* See CaseFolding.txt and the Unicode Standard for how to apply the case foldings.
*/
private static final int FOLDING_SIMPLE_[] = {
// input, default, exclude special i
0x61, 0x61, 0x61,
0x49, 0x69, 0x131,
0x130, 0x69, 0x69,
0x130, 0x130, 0x69,
0x131, 0x131, 0x131,
0xdf, 0xdf, 0xdf,
0xfb03, 0xfb03, 0xfb03,

View file

@ -1155,15 +1155,7 @@ public final class UCaseProps {
0049; C; 0069; # LATIN CAPITAL LETTER I
0130; F; 0069 0307; # LATIN CAPITAL LETTER I WITH DOT ABOVE
* U+0130 is otherwise lowercased to U+0069 (UnicodeData.txt).
*
* In case this code is used with CaseFolding.txt from an older version of Unicode
* where CaseFolding.txt contains mappings with a status of 'I' that
* have the opposite polarity ('I' mappings are included by default but excluded for Turkic),
* we must also hardcode the Unicode 3.2 mappings for the code points
* with 'I' mappings.
* Unicode 3.1.1 has 'I' mappings for U+0130 and U+0131.
* Unicode 3.2 has a 'T' mapping for U+0130, and lowercases U+0131 to itself (see UnicodeData.txt).
* U+0130 has no simple case folding (simple-case-folds to itself).
*/
/**
@ -1192,8 +1184,8 @@ public final class UCaseProps {
/* 0049; C; 0069; # LATIN CAPITAL LETTER I */
return 0x69;
} else if(c==0x130) {
/* no simple default mapping for U+0130, use UnicodeData.txt */
return 0x69;
/* no simple case folding for U+0130 */
return c;
}
} else {
/* Turkic mappings */