summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-05-22 11:25:36 -0700
committerThiago Macieira <thiago.macieira@intel.com>2020-08-05 21:51:24 -0700
commit45838673df6e64a6fd42570c4e8874c5181f7717 (patch)
tree2ad8addd10efbb69191861d6e4960e20f7839ac3 /src/corelib/serialization
parent9422b5ebc3592f4687650a84131e736219308b9f (diff)
Implement UTF-16 to UTF-8 case-insensitive compare and make public
Change-Id: Ied637aece2a7427b8a2dfffd16116cf3645c6359 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r--src/corelib/serialization/qcborvalue.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp
index 7e2d8003c7..ea2d092a1f 100644
--- a/src/corelib/serialization/qcborvalue.cpp
+++ b/src/corelib/serialization/qcborvalue.cpp
@@ -1168,6 +1168,7 @@ static int compareElementRecursive(const QCborContainerPrivate *c1, const Elemen
if (!(e1.flags & Element::StringIsAscii) || !(e2.flags & Element::StringIsAscii)) {
// Case 2: one of them is UTF-8 and the other is UTF-16, so lengths
// are NOT comparable. We need to convert to UTF-16 first...
+ // (we can't use QUtf8::compareUtf8 because we need to compare lengths)
auto string = [](const Element &e, const ByteData *b) {
return e.flags & Element::StringIsUtf16 ? b->asQStringRaw() : b->toUtf8String();
};