summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qutfcodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs/qutfcodec.cpp')
-rw-r--r--src/corelib/codecs/qutfcodec.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index f7d3b06..7655c51 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -326,11 +326,11 @@ QString QUtf16::convertToUnicode(const char *chars, int len, QTextCodec::Convert
ch.setCell(*chars++);
}
if (!headerdone) {
+ headerdone = true;
if (endian == DetectEndianness) {
- if (ch == QChar::ByteOrderSwapped && endian != BigEndianness) {
+ if (ch == QChar::ByteOrderSwapped) {
endian = LittleEndianness;
- } else if (ch == QChar::ByteOrderMark && endian != LittleEndianness) {
- // ignore BOM
+ } else if (ch == QChar::ByteOrderMark) {
endian = BigEndianness;
} else {
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
@@ -344,7 +344,6 @@ QString QUtf16::convertToUnicode(const char *chars, int len, QTextCodec::Convert
} else if (ch != QChar::ByteOrderMark) {
*qch++ = ch;
}
- headerdone = true;
} else {
*qch++ = ch;
}