*/
int32_t maybeTitleDutchIJ(const uint8_t *src, UChar32 c, int32_t start, int32_t segmentLimit,
ByteSink &sink, uint32_t options, icu::Edits *edits, UErrorCode &errorCode) {
+ U_ASSERT(start < segmentLimit);
int32_t index = start;
bool withAcute = false;
}
/* Special case Dutch IJ titlecasing */
- if (titleStart+1 < index &&
+ if (titleLimit < index &&
caseLocale == UCASE_LOC_DUTCH) {
if (c < 0) {
c = ~c;
int32_t maybeTitleDutchIJ(const UChar *src, UChar32 c, int32_t start, int32_t segmentLimit,
UChar *dest, int32_t &destIndex, int32_t destCapacity, uint32_t options,
icu::Edits *edits) {
+ U_ASSERT(start < segmentLimit);
int32_t index = start;
bool withAcute = false;
{u"íjabc\u0308", u"Íjabc\u0308", u"Í"},
{u"íj́abc\U0001D16E", u"ÍJ́abc\U0001D16E", u"ÍJ"},
{u"íjabc\u1ABE", u"Íjabc\u1ABE", u"Í"},
+
+ // Bug ICU-21919
+ {u"Í", u"Í", u""},
};
for (const auto& cas : dutchTitleTestCases) {
testOptions
);
}
-
}
}
#endif
private static <A extends Appendable> int maybeTitleDutchIJ(
CharSequence src, int c, int start, int segmentLimit,
A dest, int options, Edits edits) throws IOException {
+ assert start < segmentLimit;
+
int index = start;
boolean withAcute = false;
{"íjabc\u0308", "Íjabc\u0308", "Í"},
{"íj́abc\uD834\uDD6E", "ÍJ́abc\uD834\uDD6E", "ÍJ"},
{"íjabc\u1ABE", "Íjabc\u1ABE", "Í"},
+
+ // Bug ICU-21919
+ {"Í", "Í", ""},
};
for (String[] caseDatum : dutchIJCasesData) {