diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-06-07 18:39:12 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-08 05:06:28 +0200 |
commit | 2ccf4c32cc593f568581dd237e1e27d39fd965a2 (patch) | |
tree | ed3e0267fe8f6dfd193a0aa5769bf9d2f46bb3c8 /src/corelib | |
parent | d4dba8a5c414bfdd7cbec6e6ee133f04604b2d2c (diff) |
QUrl stringprep: recalculate the current position if the size changes
If the case folding operation results in either expansion or reduction
of the string, we need to adapt. Reduction happens most often when a
non-BMP character is case-folded to a character in the BMP (example:
mathematical signs at U+1D400-1D7FF). Expansion happens in the rare
case of symbols containing words, like U+2121 ℡ (this is part of the
unit test), and one common case: the German sharp S (ß) is expanded to
"ss".
Change-Id: I1bdbdc908b958a89bf30e4bb648d65dfdd9097f8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qurlidna.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index fac1703da8..7478099e9e 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1472,7 +1472,8 @@ static void mapToLowerCase(QString *str, int from) if (uc <= 0xffff) str->replace(i, 1, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); else - str->replace(i-1, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); + str->replace(--i, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); + i += l - 1; d = 0; } else { if (!d) |