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 <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 054a64ce67421b213df73a9bcfda3fa6e9c6e64f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2023-06-02 19:01:09 +02:00 committed by Qt Cherry-pick Bot
parent 211ff8ac53
commit 49f488c855

View File

@ -471,7 +471,7 @@ QT_BEGIN_NAMESPACE
/*! /*!
\fn qsizetype QStringView::size() const \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 surrogate pairs count as two for the purposes of this function, the same
as in QString). as in QString).