[Development] Prettier printing of Unicode strings

Thiago Macieira thiago.macieira at intel.com
Tue Jan 28 17:09:40 CET 2014


On terça-feira, 28 de janeiro de 2014 10:59:08, Oswald Buddenhagen wrote:
> On Mon, Jan 27, 2014 at 07:25:34AM -0800, Thiago Macieira wrote:
> > On segunda-feira, 27 de janeiro de 2014 11:25:17, Konrad Rosenbaum wrote:
> > > Neither do I, but as a user of Qt I've inadvertently tricked myself
> > > often
> > > enough with additional trailing spaces (please highlight those as
> > > well!),
> > 
> > Trailing spaces is a compelling argument for wrapping the full string with
> > "", like qDebug does.
> 
> not necessarily ... you can do like kconfig does: escape the
> leading/trailing space as \s (as you use escapes anyway).

That requires a more complex algorithm. The more complex it is, the bigger the 
chances of introducing a mistake and then skewing the test result.

I had been thinking of doing the quotes anyway because the output becomes then 
something you can copy back into your test sources as valid C++ code (C++11 
with unicode strings for QString).
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140128/11ca0c96/attachment.sig>


More information about the Development mailing list