With Qt5, the following code will return 3, but with Qt6 it returns 6:
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.