Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.2
-
-
dd0ddad63 (dev), b183f7e84 (6.7), 3d0b5d42e (tqtc/lts-6.5), 69a761a2c (dev), 5234c2ba4 (6.8), 9bff10a5f (6.7), 5fda33695 (tqtc/lts-6.5)
-
Foundation PM Staging
Description
Reproducer is attached.
QTextCodec::fromUnicode in Qt6 (Qt5 compat module) gives a different result from Qt5.
In encoding from Unicode to UTF-16LE, the outputs are as shown below:
Qt 5.15.16
"\xFF\xFE""1\x00""2\x00""3\x00""4\x00""5\x00" <== "12345" encoded by QTextCodec "\xFF\xFE""1\x00""2\x00""3\x00""4\x00""5\x00" <== by QTextEncoder "\xFF\xFE""a\x00""b\x00""c\x00""d\x00""e\x00" <== "abcde" encoded by QTextCodec "\xFF\xFE""a\x00""b\x00""c\x00""d\x00""e\x00" <== by QTextEncoder
Qt 6.6.2
"1\x00""2\x00""3\x00""4\x00""5\x00" <== "12345" encoded by QTextCodec "\xFF\xFE""1\x00""2\x00""3\x00""4\x00""5\x00" <== by QTextEncoder "a\x00""b\x00""c\x00""d\x00""e\x00" <== "abcde" encoded by QTextCodec "\xFF\xFE""a\x00""b\x00""c\x00""d\x00""e\x00" <== by QTextEncoder
As shown here, BOM (Byte Order Mark) is missing in QTextCodec's output in Qt6.
This issue was reported by a customer.
The customer needs a workaround, or the infomation about encodings that are affected by QTextCodec in the sameway at least.