From 1c0b69eac521fec074390c023be8b5a23e88dd50 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 5 Feb 2020 15:42:41 +0100 Subject: Only read the first BOM as a BOM; the rest are ZWNBS ! QUtf32::convertToUnicode() was forgetting to set headerdone when it dealt with the header (for contrast, Utf16::convertToUnicode() does). Fixes: QTBUG-62011 Change-Id: Ia254782ce0967a6cf9ce0e81eb06d41521150eed Reviewed-by: Qt CI Bot Reviewed-by: Lars Knoll --- src/corelib/codecs/qutfcodec.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/codecs/qutfcodec.cpp') diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index af36bd7e2f..8561f908b9 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -930,6 +930,7 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert tuple[num++] = *chars++; if (num == 4) { if (!headerdone) { + headerdone = true; if (endian == DetectEndianness) { if (tuple[0] == 0xff && tuple[1] == 0xfe && tuple[2] == 0 && tuple[3] == 0 && endian != BigEndianness) { endian = LittleEndianness; -- cgit v1.2.3