summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-04-23 18:11:57 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-24 21:45:00 +0200
commitba0d752c2dcfbbfb9a1ebc40ce01e40c64d21494 (patch)
tree4cc6b17075e222dfb85af477248ad3d03af7a1e7 /src/corelib/tools/qstring.cpp
parent4ca3d4ebab4f1133e48b3cfd978378fc1928cff3 (diff)
workaround issue where casing diff overflows signed short
there are two such codepoints were added in the Unicode 5.1: U+1D79 LATIN SMALL LETTER INSULAR G U+A77D LATIN CAPITAL LETTER INSULAR G two more of them were added in the Unicode 6.0: U+0265 LATIN SMALL LETTER TURNED H U+A78D LATIN CAPITAL LETTER TURNED H and two more were added in the Unicode 6.1: U+0266 LATIN SMALL LETTER H WITH HOOK U+A7AA LATIN CAPITAL LETTER H WITH HOOK we map them like special cases with length == 1 (note: all are in BMP which is checked explicitly in the generator) Change-Id: I8a34164eb3ee2e575b7799cc12d4b96ad5bcd9c6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 65b52f3229..39747aa3e9 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -5263,7 +5263,20 @@ QString QString::toCaseFolded() const
prop = qGetProp(*p);
}
if (prop->caseFoldSpecial) {
+ const ushort *specialCase = specialCaseMap + prop->caseFoldDiff;
+ ushort length = *specialCase++;
+#if 0
+ int pos = pp - s.d->data;
+ s.resize(s.d->size + length - 1);
+ pp = s.d->data + pos;
+ while (length--)
+ *pp++ = *specialCase++;
+#else
//### we currently don't support full case foldings
+ Q_ASSERT(length == 1);
+ Q_UNUSED(length)
+ *pp++ = *specialCase;
+#endif
} else {
*pp++ = *p + prop->caseFoldDiff;
}