diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-10 20:15:00 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-11 19:04:14 (GMT) |
commit | 52392292c8fa096e3b0bb692dedce66924ab3305 (patch) | |
tree | 5eb54ee501896ffd37473e490580e0072644da87 /src/corelib/codecs/qutfcodec.cpp | |
parent | a2baabcfcb60a7a0e5d3926ad6938983e50dfefc (diff) | |
download | Qt-52392292c8fa096e3b0bb692dedce66924ab3305.zip Qt-52392292c8fa096e3b0bb692dedce66924ab3305.tar.gz Qt-52392292c8fa096e3b0bb692dedce66924ab3305.tar.bz2 |
Skip the byte order mark when converting the utf16 and utf32 data
When reading one character at a time (as QTextStream::pos does) the
byte order mark could be ignored. This happens only with UTF-16 BE/LE
and UTF-32 BE/LE codecs. This fixes the qtextstream autotest.
Author: Olivier Goffart
Author: João Abecasis
Diffstat (limited to 'src/corelib/codecs/qutfcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qutfcodec.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index d9defe1..6611315 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -387,7 +387,7 @@ QString QUtf16Codec::convertToUnicode(const char *chars, int len, ConverterState result.truncate(qch - result.unicode()); if (state) { - if (endian != Detect) + if (headerdone) state->flags |= IgnoreHeader; state->state_data[Endian] = endian; if (half) { @@ -569,7 +569,7 @@ QString QUtf32Codec::convertToUnicode(const char *chars, int len, ConverterState result.truncate(qch - result.unicode()); if (state) { - if (endian != Detect) + if (headerdone) state->flags |= IgnoreHeader; state->state_data[Endian] = endian; state->remainingChars = num; |