[Development] FW: Backwards compatibiltiy break in Qt 5.5

Knoll Lars Lars.Knoll at theqtcompany.com
Fri Jul 31 12:39:43 CEST 2015


Agree with Thiago. Backslash is a good escape character, as it’s used in
pretty much all programming languages for that. If you want unescaped
paths, you can use noquote, or print the paths using slashes (using
QDir::fromNativeSeparators()).

Cheers,
Lars

On 31/07/15 10:23, "Thiago Macieira" <thiago.macieira at intel.com> wrote:

>On Friday 31 July 2015 09:29:36 André Somers wrote:
>> Does it? The output is not aimed at being C++ again. So, why is is
>> needed that the backslash is always escaped? Would it be possible to
>> only escape \ if it is followed by 0x in the actual string, and then
>> make escaped characters print as \0xAB01 or something like that (and
>> just leave the other occurences alone?) Or only escape them if there is
>> something else to escape?
>
>So you're proposing that qDebug should output:
>
>"C:\\Users"
>"C:\\users"
>"C:\\01.org"
>"C:\\newdir"
>"C:\Windows"
>
>Sorry, no, that's a total veto from me.
>
>> Or even choose a different escape character completely, one that is not
>>used
>> as often?
>
>I don't think that's a good idea. What character can we use that is among
>the 
>94 from US-ASCII that aren't control characters already or the space?
>It's 
>only going to punt the problem elsewhere and cause more confusion because
>such 
>character is not used as often to escape things.
>
>It has to be a non-control character because this thread has shown that
>qDebug 
>output is read by people. A control character that isn't visible can't be
>seen 
>by people.
>
>The only alternative is to not escape the backslash and the quote at all,
>in 
>which case these two completely different strings would be printed the
>same 
>way:
>
>	QString("C:\\u00a0");
>	QString::fromUtf8("C:\\u\xc3\xa0");
>as
>	"C:\u00a0"
>
>-- 
>Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
>
>_______________________________________________
>Development mailing list
>Development at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list