From 49f488c8554bd0176ae4e62b7222451b092449ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 2 Jun 2023 19:01:09 +0200 Subject: [PATCH] QStringView: size is encoded with code units not code points Code points is what you get when surrogate pairs have been joined Change-Id: I86c4131de5782ce1e6342217947a603ca16bb521 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Thiago Macieira (cherry picked from commit 054a64ce67421b213df73a9bcfda3fa6e9c6e64f) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstringview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qstringview.cpp b/src/corelib/text/qstringview.cpp index 914f5a39d9a..302637eebf8 100644 --- a/src/corelib/text/qstringview.cpp +++ b/src/corelib/text/qstringview.cpp @@ -471,7 +471,7 @@ QT_BEGIN_NAMESPACE /*! \fn qsizetype QStringView::size() const - Returns the size of this string view, in UTF-16 code points (that is, + Returns the size of this string view, in UTF-16 code units (that is, surrogate pairs count as two for the purposes of this function, the same as in QString).