summaryrefslogtreecommitdiffstats
path: root/src/corelib/xml/qxmlstream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/xml/qxmlstream.cpp')
-rw-r--r--src/corelib/xml/qxmlstream.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index e31ed6d..f879315 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3005,8 +3005,7 @@ QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q)
deleteDevice = false;
#ifndef QT_NO_TEXTCODEC
codec = QTextCodec::codecForMib(106); // utf8
- encoder = codec->makeEncoder();
- encoder->fromUnicode(QLatin1String("")); // no byte order mark for utf8
+ encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8
#endif
inStartElement = inEmptyElement = false;
wroteSomething = false;
@@ -3280,9 +3279,7 @@ void QXmlStreamWriter::setCodec(QTextCodec *codec)
if (codec) {
d->codec = codec;
delete d->encoder;
- d->encoder = codec->makeEncoder();
- if (codec->mibEnum() == 106)
- d->encoder->fromUnicode(QLatin1String("")); // no byte order mark for utf8
+ d->encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8
}
}