Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.2.0
-
None
-
-
a43dd9a6b1b1218a4c39943ba349416265ab8c68 (qt/qtbase/dev), 40a811645 (tqtc/lts-6.2)
Description
With Qt5, the following code will return 3, but with Qt6 it returns 6:
QString(QByteArray("foo\0\0\0", 6)).size()
The documentation of QString(QByteArray) still says this:
Stops copying at the first 0 character, otherwise copies the entire byte array.
But it looks like that's not true anymore since QByteArrayView was introduced.
QString::fromUtf8 and QString::fromLatin1 also do this, but the documentation isn't clear about the correct behavior.