[Development] Prettier printing of Unicode strings
Thiago Macieira
thiago.macieira at intel.com
Sun Jan 26 20:39:13 CET 2014
On domingo, 26 de janeiro de 2014 12:36:27, Jan Kundrát wrote:
> On Tuesday, 21 January 2014 01:05:07 CEST, Thiago Macieira wrote:
> > Actual (s) : \u221212\u20A0\uD800\uDC00
> > Expected (s2): \u221212\u20AC\uD800\uDC00
>
> [...]
>
> > - all backslashes as \\
> > - the following characters as their escape sequences: \r, \n, \t, \b, \f
> > - all other control characters (including 0x7f) as \u00XX
> > - all other characters with \uXXXX, including text otherwise
> >
> > readable in the
> >
> > terminal in the locale
>
> The rules you describe appear to be out-of-sync with what the example above
> shows. Is there perhaps a rule "English letters, punctuation and numbers
> are displayed as-is"?
I failed to exclude ASCII 0x20 to 0x7f (except the backslash) in "all other
characters"
> If that is the case, then it looks like a good change.
>
> > Should I also do the same for QByteArray? Reading hex dumps isn't very
>
> nice.
>
> Yes -- I have used QString::fromUtf8(bytearray) multiple times in my tests
> to produce an ugly workaround.
Done.
--
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/20140126/73bf4046/attachment.sig>
More information about the Development
mailing list