// We need not look at control codes, Han characters nor Hangul LVT syllables because they
// do not combine forward. LV syllables are already removed.
UnicodeSet notInteresting("[[:C:][:Unified_Ideograph:][:HST=LVT:]]", errorCode);
- LocalPointer<UnicodeSet> unsure(&((UnicodeSet *)(skipSets[UNORM_NFC].clone()))->removeAll(notInteresting));
+ LocalPointer<UnicodeSet> unsure(&(skipSets[UNORM_NFC].clone())->removeAll(notInteresting));
// System.out.format("unsure.size()=%d\n", unsure.size());
// For each character about which we are unsure, see if it changes when we add
return;
}
static const char *const src =
- u8" AÄA\u0308A\u0308\u00ad\u0323Ä\u0323,\u00ad\u1100\u1161가\u11A8가\u3133 ";
- std::string expected = u8" aääạ\u0308ạ\u0308,가각갃 ";
+ reinterpret_cast<const char*>(u8" AÄA\u0308A\u0308\u00ad\u0323Ä\u0323,\u00ad\u1100\u1161가\u11A8가\u3133 ");
+ std::string expected = reinterpret_cast<const char*>(u8" aääạ\u0308ạ\u0308,가각갃 ");
std::string result;
StringByteSink<std::string> sink(&result, static_cast<int32_t>(expected.length()));
Edits edits;
assertTrue("isNormalizedUTF8(normalized)", nfkc_cf->isNormalizedUTF8(result, errorCode));
// Omit unchanged text.
- expected = u8"aääạ\u0308ạ\u0308가각갃";
+ expected = reinterpret_cast<const char*>(u8"aääạ\u0308ạ\u0308가각갃");
result.clear();
edits.reset();
nfkc_cf->normalizeUTF8(U_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
// With filter: The normalization code does not see the "A" substrings.
UnicodeSet filter(u"[^A]", errorCode);
FilteredNormalizer2 fn2(*nfkc_cf, filter);
- expected = u8" AäA\u0308A\u0323\u0308ạ\u0308,가각갃 ";
+ expected = reinterpret_cast<const char*>(u8" AäA\u0308A\u0323\u0308ạ\u0308,가각갃 ");
result.clear();
edits.reset();
fn2.normalizeUTF8(0, src, sink, &edits, errorCode);
// Omit unchanged text.
// Note that the result is not normalized because the inner normalizer
// does not see text across filter spans.
- expected = u8"ä\u0323\u0308ạ\u0308가각갃";
+ expected = reinterpret_cast<const char*>(u8"ä\u0323\u0308ạ\u0308가각갃");
result.clear();
edits.reset();
fn2.normalizeUTF8(U_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
assertSuccess("normalize", errorCode.get());
assertEquals("normalize", expected, result);
- std::string src8(u8" A");
- src8.append("\x80").append(u8"ÄA\u0308").append("\xC0\x80").
- append(u8"A\u0308\u00ad\u0323").append("\xED\xA0\x80").
- append(u8"Ä\u0323,\u00ad").append("\xF4\x90\x80\x80").
- append(u8"\u1100\u1161가\u11A8가\u3133 ").append("\xF0");
- std::string expected8(u8" a");
- expected8.append("\x80").append(u8"ää").append("\xC0\x80").
- append(u8"ạ\u0308").append("\xED\xA0\x80").
- append(u8"ạ\u0308,").append("\xF4\x90\x80\x80").
- append(u8"가각갃 ").append("\xF0");
+ std::string src8(reinterpret_cast<const char*>(u8" A"));
+ src8.append("\x80").append(reinterpret_cast<const char*>(u8"ÄA\u0308")).append("\xC0\x80").
+ append(reinterpret_cast<const char*>(u8"A\u0308\u00ad\u0323")).append("\xED\xA0\x80").
+ append(reinterpret_cast<const char*>(u8"Ä\u0323,\u00ad")).append("\xF4\x90\x80\x80").
+ append(reinterpret_cast<const char*>(u8"\u1100\u1161가\u11A8가\u3133 ")).append("\xF0");
+ std::string expected8(reinterpret_cast<const char*>(u8" a"));
+ expected8.append("\x80").append(reinterpret_cast<const char*>(u8"ää")).append("\xC0\x80").
+ append(reinterpret_cast<const char*>(u8"ạ\u0308")).append("\xED\xA0\x80").
+ append(reinterpret_cast<const char*>(u8"ạ\u0308,")).append("\xF4\x90\x80\x80").
+ append(reinterpret_cast<const char*>(u8"가각갃 ")).append("\xF0");
std::string result8;
StringByteSink<std::string> sink(&result8);
nfkc_cf->normalizeUTF8(0, src8, sink, nullptr, errorCode);
assertFalse("isNormalized(LV+11A7)", nfkc->isNormalized(s, errorCode));
assertTrue("isNormalized(normalized)", nfkc->isNormalized(result, errorCode));
- std::string s8(u8"\u1100\u1161\u11A7\u1100\u314F\u11A7가\u11A7");
- std::string expected8(u8"가\u11A7가\u11A7가\u11A7");
+ std::string s8(reinterpret_cast<const char*>(u8"\u1100\u1161\u11A7\u1100\u314F\u11A7가\u11A7"));
+ std::string expected8(reinterpret_cast<const char*>(u8"가\u11A7가\u11A7가\u11A7"));
std::string result8;
StringByteSink<std::string> sink(&result8, static_cast<int32_t>(expected8.length()));
nfkc->normalizeUTF8(0, s8, sink, nullptr, errorCode);