Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P0: Blocker
-
Resolution: Cannot Reproduce
-
Affects Version/s: 6.0.0 Alpha
-
Fix Version/s: None
-
Component/s: Core: QString and Unicode
-
Labels:None
Description
In the initial Qt 6.0 Alpha release, the QStringConverter::encodingForData function was inserting a zero character somewhere at the start of the string:
#include <QByteArray> #include <QDebug> #include <QStringConverter> int main() { const QByteArray bytes { "Foo bar baz" }; qDebug() << "before:" << bytes; QStringConverter::encodingForData(bytes.constData(), bytes.size()); qDebug() << "after :" << bytes; }
output:
before: "Foo bar baz" after : "Foo \x00""ar baz"
See comment for updated version for the latest Qt 6.0 Alpha release, where the parameter changed to QByteArrayView, which now crashes on this example.