From a2baabcfcb60a7a0e5d3926ad6938983e50dfefc Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 10 Jun 2009 22:13:57 +0200 Subject: Use the old codec if there is one available when reading data in qtextstream. Reviewed-by: trustme --- src/corelib/io/qtextstream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 7c925f1..75c682a 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -561,7 +561,7 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes) if (!codec || autoDetectUnicode) { autoDetectUnicode = false; - codec = QTextCodec::codecForUtfText(QByteArray::fromRawData(buf, bytesRead), 0); + codec = QTextCodec::codecForUtfText(QByteArray::fromRawData(buf, bytesRead), codec); if (!codec) { codec = QTextCodec::codecForLocale(); writeConverterState.flags |= QTextCodec::IgnoreHeader; -- cgit v0.12