mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-7264 mark characters as disallowed_STD3_valid if their decompositions contain STD3-disallowed characters
X-SVN-Rev: 28562
This commit is contained in:
parent
9c5573b1f9
commit
4e91247beb
1 changed files with 4 additions and 6 deletions
|
@ -244,9 +244,7 @@ main(int argc, const char *argv[]) {
|
|||
icu::UnicodeSetIterator iter(validSet);
|
||||
while(iter.next()) {
|
||||
UChar32 c=iter.getCodepoint();
|
||||
cString.setTo(c);
|
||||
nfd->normalize(cString, nfdString, errorCode);
|
||||
if(!validSet.containsAll(nfdString)) {
|
||||
if(nfd->getDecomposition(c, nfdString) && !validSet.containsAll(nfdString)) {
|
||||
fprintf(stderr, "U+%04lX valid -> disallowed: NFD not wholly valid\n", (long)c);
|
||||
disallowedSet.add(c);
|
||||
removeSet.add(c);
|
||||
|
@ -286,7 +284,7 @@ main(int argc, const char *argv[]) {
|
|||
// output
|
||||
UChar32 prevStart=0, c=0;
|
||||
Status prevStatus=DISALLOWED_STD3_VALID, status;
|
||||
icu::UnicodeString prevMapping, decomposition;
|
||||
icu::UnicodeString prevMapping;
|
||||
UVersionInfo prevAge={ 1, 1, 0, 0 }, age;
|
||||
|
||||
icu::UnicodeSetIterator iter(disallowedSet);
|
||||
|
@ -306,8 +304,8 @@ main(int argc, const char *argv[]) {
|
|||
} else if(disallowedSTD3Set.contains(c)) {
|
||||
status=DISALLOWED_STD3_VALID;
|
||||
} else if(validSet.contains(c)) {
|
||||
if( nfd->getDecomposition(c, decomposition) &&
|
||||
disallowedSTD3Set.containsSome(decomposition)
|
||||
if( nfd->getDecomposition(c, nfdString) &&
|
||||
disallowedSTD3Set.containsSome(nfdString)
|
||||
) {
|
||||
status=DISALLOWED_STD3_VALID;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue