ucs4 = QChar::surrogateToUcs4(high, ucs4);
}
}
- if (QChar::unicodeVersion(ucs4) > version)
+ const QChar::UnicodeVersion v = QChar::unicodeVersion(ucs4);
+ if (v > version || v == QChar::Unicode_Unassigned)
continue;
int length;
int tag;
return 0;
}
-static void composeHelper(QString *str, int from)
+static void composeHelper(QString *str, QChar::UnicodeVersion version, int from)
{
QString &s = *str;
++pos;
}
}
- int combining = QChar::combiningClass(uc);
+ const QUnicodeTables::Properties *p = qGetProp(uc);
+ if (p->unicodeVersion > version || p->unicodeVersion == QChar::Unicode_Unassigned) {
+ starter = -1; // to prevent starter == pos - 1
+ lastCombining = 0;
+ ++pos;
+ continue;
+ }
+ int combining = p->combiningClass;
if (starter == pos - 1 || combining > lastCombining) {
// allowed to form ligature with S
QChar ligature = ligatureHelper(s.at(starter).unicode(), uc);
ushort c2 = 0;
{
const QUnicodeTables::Properties *p = qGetProp(u2);
- if ((QChar::UnicodeVersion)p->unicodeVersion <= version)
+ if (p->unicodeVersion <= version && p->unicodeVersion != QChar::Unicode_Unassigned)
c2 = p->combiningClass;
}
if (c2 == 0) {
ushort c1 = 0;
{
const QUnicodeTables::Properties *p = qGetProp(u1);
- if ((QChar::UnicodeVersion)p->unicodeVersion <= version)
+ if (p->unicodeVersion <= version && p->unicodeVersion != QChar::Unicode_Unassigned)
c1 = p->combiningClass;
}