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.
Attachments
For Gerrit Dashboard: QTBUG-97451 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
376441,4 | QLatin1String: harmonize null byte handling with the rest of QString | dev | qt/qtbase | Status: MERGED | +2 | 0 |
376442,3 | Doc: QString: formalize that we now include the QBA's nulls | dev | qt/qtbase | Status: MERGED | +2 | 0 |
526808,2 | Doc: QString: formalize that we now include the QBA's nulls | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |