diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-06-08 01:42:04 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-21 00:31:34 (GMT) |
commit | 154823904672bd89255dd647a2fe609f8fbd74b0 (patch) | |
tree | b85ff0d6b93c819652233f54d2bf57237d9ac0fe | |
parent | 49239612ecbc57258e855012da617a3edaff7492 (diff) | |
download | Qt-154823904672bd89255dd647a2fe609f8fbd74b0.zip Qt-154823904672bd89255dd647a2fe609f8fbd74b0.tar.gz Qt-154823904672bd89255dd647a2fe609f8fbd74b0.tar.bz2 |
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_qurl, but it is being
obscured by another bug (false positive).
(cherry-picked from qtbase commit 86312275197c3fde948035a59c0358162701f9f2)
Change-Id: I32388dd5bef32d4d6804aeeec4904bd5f563e9b9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
-rw-r--r-- | src/corelib/io/qurl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 1a5fad8..14b9037 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2404,7 +2404,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 |