mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-7736 test and fix FilteredNormalizer2::getDecomposition()
X-SVN-Rev: 28163
This commit is contained in:
parent
ea1a61a42a
commit
9cbd929fca
2 changed files with 10 additions and 1 deletions
|
@ -150,7 +150,7 @@ FilteredNormalizer2::normalizeSecondAndAppend(UnicodeString &first,
|
|||
|
||||
UBool
|
||||
FilteredNormalizer2::getDecomposition(UChar32 c, UnicodeString &decomposition) const {
|
||||
return !set.contains(c) && norm2.getDecomposition(c, decomposition);
|
||||
return set.contains(c) && norm2.getDecomposition(c, decomposition);
|
||||
}
|
||||
|
||||
UBool
|
||||
|
|
|
@ -1164,6 +1164,15 @@ BasicNormalizerTest::TestCompare() {
|
|||
) {
|
||||
errln("NFC.getDecomposition() returns TRUE for characters which do not have decompositions");
|
||||
}
|
||||
|
||||
// test FilteredNormalizer2::getDecomposition()
|
||||
UnicodeSet filter(UNICODE_STRING_SIMPLE("[^\\u00a0-\\u00ff]"), errorCode);
|
||||
FilteredNormalizer2 fn2(*nfcNorm2, filter);
|
||||
if( fn2.getDecomposition(0xe4, s1) || !fn2.getDecomposition(0x100, s2) ||
|
||||
s2.length()!=2 || s2[0]!=0x41 || s2[1]!=0x304
|
||||
) {
|
||||
errln("FilteredNormalizer2(NFC, ^A0-FF).getDecomposition() failed");
|
||||
}
|
||||
}
|
||||
|
||||
// verify that case-folding does not un-FCD strings
|
||||
|
|
Loading…
Add table
Reference in a new issue