[Interest] QDateTime + QXmlStreamWriter on non-UTF8 compatible systems

Thiago Macieira thiago.macieira at intel.com
Tue Dec 26 12:44:32 CET 2017


On terça-feira, 26 de dezembro de 2017 09:14:22 -02 Scott Bloom wrote:
> What would you have it write?
> ====
> If I set the encoding, I would expect it to use that encoding.  It doesn't. 
> When using QString, all encoding settings are ignored.  That to me is a
> problem, at a minimum it should be documented as the expected and correct
> behavior.

Because you're writing to QString, which means it's UTF-16. The codec is *not* 
used when using a QString, for obvious reasons.

> If I set the encoding to "UTF-8" and the target is a QString, it should
> encode to UTF-8 in the QString.

Will never happen. If yuo want to use UTF-8, use QByteArray, not QString.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list