[Qt-interest] QXmlStreamWriter not adding encoding attribute.

JD Guzman lostinthecode at googlemail.com
Tue May 17 00:44:13 CEST 2011


Hello all,

Now I may be doing something wrong but I can't seem to get the xml stream writer to add the encoding attribute to the xml tag.  Here is my sample code.

QString meta;
QXmlStreamWriter writer(&meta);
writer.setAutoFormatting(true);
writer.writeStartDocument();
writer.writeEndDocument();

return meta;


Here is what the output looks like.

<?xml version="1.0"?>

As you can see this is not what I woud expect which is.

<?xml version="1.0" encoding="UTF-8"?>

Any ideas?

Regards,

JD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110516/47797450/attachment.html 


More information about the Qt-interest-old mailing list