[Development] Prettier printing of Unicode strings
Jan Kundrát
jkt at flaska.net
Sun Jan 26 12:36:27 CET 2014
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"?
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.
Cheers,
Jan
--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
More information about the Development
mailing list