Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 3.3.1
-
None
-
Ubuntu 14.04, 64 bit.
-
3e02f8ec2ee88af43437a736c234b2091f13cfba
Description
Consider following code:
int main() { char const str1[] = "ัะตัั"; return 0; }
"str1" initialized with some non-ascii UTF-8 string.
By default Qt Creator displays strings as Latin-1 strings, so it's displayed as gibberish (see attached screenshot "char_array_default.png").
Qt Creator has convenient feature in debugger: change variable display format to treat it specially. For string-like types it's possible to select string encoding: Latin-1, UTF-8 or UCS-4.
The issue is that for char arrays this settings changes visualization from string type to array type, see attached screenshot "char_array_as_utf8.png"
Workaround to see "char[]" types as UTF-8 strings is to add expression evaluator, where convert "char[]" type to "char *", and select encoding for it.