From 45838673df6e64a6fd42570c4e8874c5181f7717 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 22 May 2020 11:25:36 -0700 Subject: Implement UTF-16 to UTF-8 case-insensitive compare and make public Change-Id: Ied637aece2a7427b8a2dfffd16116cf3645c6359 Reviewed-by: Lars Knoll --- src/corelib/serialization/qcborvalue.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/serialization/qcborvalue.cpp') 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(); }; -- cgit v1.2.3