diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-03-09 17:01:09 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-03-09 17:11:50 (GMT) |
commit | 7837de27309c958dc5a5985afc55492ec3054ee0 (patch) | |
tree | 4028c192ffec714502c659b9fced67b0f8a0155d /src/corelib | |
parent | 65dc878e857ec97c1dbccddc3809eb68ed379fc9 (diff) | |
download | Qt-7837de27309c958dc5a5985afc55492ec3054ee0.zip Qt-7837de27309c958dc5a5985afc55492ec3054ee0.tar.gz Qt-7837de27309c958dc5a5985afc55492ec3054ee0.tar.bz2 |
Don't write byte-order-mark after seek()
Ideally, we should write a BOM after seek(0) if setGenerateByteOrderMark
has been called, but we don't store that information. This commit is an
improvement for the default case when generateByteOrderMark is false, and
also when seeking to any other position than 0.
Task-number: QTBUG-6295
Reviewed-by: Olivier
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qtextstream.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 9e79894..b1c403f 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -70,7 +70,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; have reached the end of the data stream, with stdin. The reason for this is that as long as stdin doesn't give any input to the QTextStream, \c atEnd() will return true even if the stdin is open and waiting for more characters. - + Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or setString(). You can seek to a position by calling seek(), and @@ -1196,6 +1196,7 @@ bool QTextStream::seek(qint64 pos) resetCodecConverterStateHelper(&d->writeConverterState); delete d->readConverterSavedState; d->readConverterSavedState = 0; + d->writeConverterState.flags |= QTextCodec::IgnoreHeader; #endif return true; } |