summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurlidna.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-06-07 18:42:04 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-08 05:06:42 +0200
commit86312275197c3fde948035a59c0358162701f9f2 (patch)
treea5435a87ed8089fbc2aeaa06eed101f80eb47e7b /src/corelib/io/qurlidna.cpp
parent2ccf4c32cc593f568581dd237e1e27d39fd965a2 (diff)
QUrl stringprep: fix case folding from non-BMP to BMP
When uc > 0xffff (non-BMP character) and l == 1 (replacement is in the BMP), we must use QString::replace so the correct number of characters is replaced. There's one case testing this in tst_qurlinternal, but it is being obscured by another bug (false positive). Change-Id: I32388dd5bef32d4d6804aeeec4904bd5f563e9b9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/corelib/io/qurlidna.cpp')
-rw-r--r--src/corelib/io/qurlidna.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index 7478099e9e..9bb6b2a42d 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -1468,7 +1468,7 @@ static void mapToLowerCase(QString *str, int from)
int l = 1;
while (l < 4 && entry->mapping[l])
++l;
- if (l > 1) {
+ if (l > 1 || uc > 0xffff) {
if (uc <= 0xffff)
str->replace(i, 1, reinterpret_cast<const QChar *>(&entry->mapping[0]), l);
else