[Interest] Text resources

Sze Howe Koh szehowe.koh at gmail.com
Sun May 15 08:04:25 CEST 2022


On Sun, 15 May 2022 at 07:24, Turtle Creek Software
<support at turtlesoft.com> wrote:
>
> We just started moving a Mac project to Windows.
>
> When reading text resources into a QString, the Win version automatically replaces all /n line endings with /r/n.  That screws up our line parsing.

Shouldn't it be the other way round...? A text file Reader converts
"\r\n" to "\n" on Windows.

It's a text file Writer that converts "\n" in a QString to "\r\n" in a
file on Windows.


> The code creates a QString from QFile:readAll(), and the change happens somewhere in that constructor.
>
> Is there a way to prevent that behavior?  Using QFile::readLine() would be a pain.
>
> Thanks, Casey McD

What behaviour do you want, and how does it make it less painful?


Regards,
Sze-Howe


More information about the Interest mailing list