[Qt-interest] QXmlStreamWriter not adding encoding attribute.

Thiago Macieira thiago at kde.org
Tue May 17 09:37:02 CEST 2011


On Tuesday, 17 de May de 2011 09:00:30 Andreas Pakulat wrote:
> Why not? If you look into the XML standard you'll notice that no
> encoding attribute means the encoding of the file has to be utf-8. So
> adding an explicit encoding attribute that states this would be
> redundant.
> 
> If you change the encoding to something other than utf-8 the writer
> should add the encoding attribute.

Andreas is technically right, of course.

But his answer is not the reason for the missing encoding. The encoding is 
missing because the XML was saved to a QString, for which the encoding is 
specified by construction: UTF-16.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110517/7a88d7fc/attachment.bin 


More information about the Qt-interest-old mailing list