14typedef int32_t (*
Ptr_u_strToCase)(UChar *dest, int32_t destCapacity,
const UChar *src, int32_t srcLength,
const char *locale, UErrorCode *pErrorCode);
17static bool qt_u_strToCase(
const QString &str, QString *out,
const char *localeID, Ptr_u_strToCase caseFunc)
21 int32_t size = str.size();
23 QString result(size, Qt::Uninitialized);
25 UErrorCode status = U_ZERO_ERROR;
27 size = caseFunc(
reinterpret_cast<UChar *>(result.data()), result.size(),
28 reinterpret_cast<
const UChar *>(str.constData()), str.size(),
31 if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR)
34 if (size < result.size()) {
36 }
else if (size > result.size()) {
40 status = U_ZERO_ERROR;
41 size = caseFunc(
reinterpret_cast<UChar *>(result.data()), result.size(),
42 reinterpret_cast<
const UChar *>(str.constData()), str.size(),
45 if (U_FAILURE(status))
49 if (size != result.size())
QT_BEGIN_NAMESPACE typedef int32_t(* Ptr_u_strToCase)(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode)