[Interest] Code Review For Correcting Encoding Errors

Thiago Macieira thiago.macieira at intel.com
Thu Apr 2 18:49:30 CEST 2015


On Thursday 02 April 2015 12:09:45 Kyle Neal wrote:
> Unfortunately opening a QFile with the QIODevice::Text mode flag severely
> breaks my program if it is run under Windows (since Windows has a weird
> thing of converting line endings). Doing this makes my file position to be
> way off. Also, QTextStream does not handle '\r' automatically. If I read a
> csv file with '\r' endings using QTextStream::readLine(), it reads the
> entire file into one QString. I remember reading that this was a bug that
> was reported, but was rejected and deemed "out of scope". In the discussion
> of this bug, a Qt guy says that QTextstream will never handle '\r' because
> he claimed that Qt framework is not used in OSes that use '\r' endings. You
> can see this here https://bugreports.qt.io/browse/QTBUG-18038

Wait, are you saying that your file has CR for line endings, not CRLF?

That is not supported. Only Mac OS 9 used that.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list