diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-04-12 18:21:39 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-13 10:44:28 +0200 |
commit | 9fd2edb6da5f1f6d644cd7c3f35aebe3e88beee2 (patch) | |
tree | d644aeef68584469ec1b9b6cdbc3d86cc7ddf86b /src/corelib/io | |
parent | b317fe2a606e5b79f24b1e4a1b808f5ff66d3621 (diff) |
replace hardcoded values with a surrogate handling methods
Change-Id: Ib41e08d835f2e8ca2e32b4025c6f5a99840f2e27
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 0659053937..c6b5ea63eb 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2388,7 +2388,7 @@ static void mapToLowerCase(QString *str, int from) while (l < 4 && entry->mapping[l]) ++l; if (l > 1) { - if (uc <= 0xffff) + if (!QChar::requiresSurrogates(uc)) 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); @@ -2434,7 +2434,7 @@ static void stripProhibitedOutput(QString *str, int from) uc = QChar::surrogateToUcs4(uc, low); } } - if (uc <= 0xFFFF) { + if (!QChar::requiresSurrogates(uc)) { if (uc < 0x80 || !(uc <= 0x009F || uc == 0x00A0 @@ -2991,7 +2991,7 @@ void qt_nameprep(QString *source, int from) } } if (!isMappedToNothing(uc)) { - if (uc <= 0xFFFF) { + if (!QChar::requiresSurrogates(uc)) { *out++ = *in; } else { *out++ = QChar::highSurrogate(uc); |