[Interest] QDataStream null terminated string / Bug or expected behavior?

Thiago Macieira thiago.macieira at intel.com
Fri Feb 10 17:38:21 CET 2017


Em sexta-feira, 10 de fevereiro de 2017, às 16:27:49 PST, Etienne Sandré-
Chardonnal escreveu:
> Thanks for the link. Yes, I'm doing something bad, but there is no strong
> reason to encode a string litteral differently than a QByteArray and not
> allowing this. But since retro-compatibility is more important I suppose
> this cannot be changed...

Right, there's no good reason. It's an arbitrary difference, but one it's not 
worth doing anything about right now. Maybe with a time machine if we could go 
back to Qt 3.0 days...

Anyway, QDataStream does not guatantee that you can deserialise a different 
type from what you had serialised. So don't. Ever.

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




More information about the Interest mailing list