[Qt-interest] QXmlStreamWriter setCodec

Frans Englich fenglich at trolltech.com
Thu Dec 4 15:25:48 CET 2008


On Thursday 04 December 2008 06:57:06 Sylvain Pointeau wrote:
> I did it,
> I just cannot see it for giving you the url...

Hi Sylvain,

We've had this patch in our repository for some time and it will be in Qt 4.5, 
could you give it a spin and see if it works for you?

diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index f1faf38..371bea3 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3110,6 +3110,8 @@ void QXmlStreamWriter::setCodec(QTextCodec *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
     }
 }


Cheers,

		Frans



More information about the Qt-interest-old mailing list