Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.9.1
-
None
-
1c0b69eac521fec074390c023be8b5a23e88dd50 (qt/qtbase/5.14)
Description
QString::fromUcs4() internally calls Utf32::convertToUnicode(), which defaults to detect endianess from the data (which eats leading BOM).
But QString::fromUcs4() always uses the machine endianess, so no header parsing is needed.
I suggest to call it with QTextCodec::IgnoreHeader flag set.
Test case:
uint chr = 0xFEFF;
qDebug << QString::fromUcs4(&chr, 1).toUtf8();
shows an empty QByteArray.
Attachments
For Gerrit Dashboard: QTBUG-62011 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
289417,3 | Only read the first BOM as a BOM; the rest are ZWNBS ! | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |