[Development] FW: Backwards compatibiltiy break in Qt 5.5

Thiago Macieira thiago.macieira at intel.com
Fri Jul 31 10:23:05 CEST 2015


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




More information about the Development mailing list