[Qt-interest] Have QXmlStreameWriter write the encoding information

Marc Balmer marc at msys.ch
Fri May 29 14:19:57 CEST 2009


Am 29.05.2009 um 14:16 schrieb Marc Balmer:

> Hi
>
> When I create a XML data stream using QXmlStreamWriter, my stream
> starts with
>
> <?xml version="1.0"?>
>
> How can I add the encoding information, so that I get
>
> <?xml version="1.0" encoding="UTF-8"?>
>
I forgot to add my code, so here is the snippet:

  QXmlStreamWriter xml(&xmlData);
xml.setAutoFormatting(true);
xml.setCodec("UTF-8");
xml.writeStartDocument();

xml.writeStartDocument() does not output the encoding information.




More information about the Qt-interest-old mailing list