[Interest] QTextStream, QIODevice::Text and line endings convertation
Igor Mironchik
igor.mironchik at gmail.com
Wed Nov 18 07:57:08 CET 2015
11/18/2015 12:58 AM, Thiago Macieira пишет:
> On Tuesday 17 November 2015 23:46:49 Igor Mironchik wrote:
>> QString data = QLatin1String( "/*** Program Name ***/\r\n"
>> "TEST PROGRAM TEST_00;\r\n"
>> "BEGIN\r\n"
>> "LOGIC\r\n"
>> "NAME :\r"
>> "ACTUAL_NAME\r\n"
>> "OPTION ENABLE : " );
>> And output is:
>>
>> "/*** Program Name ***/"
>>
>> "TEST PROGRAM TEST_00;"
>>
>> "BEGIN"
>>
>> "LOGIC"
>>
>> "NAME :ACTUAL_NAME"
>>
>> "OPTION ENABLE :"
>>
>>
>> Look here "NAME :ACTUAL_NAME" '\r' wasn't converted to '\n'...
> Never mind the other email. I see what you mean now.
>
> It's not a bug. Only CRLF is a converted to LF. A lone CR does not count as a
> line break.
>
> What version of Qt did you use for this? I would expect it to show the string
> slash-r in the qDebug output.
Qt 5.5.1
More information about the Interest
mailing list