I had checked that GDB send utf-8 string to visualgdb like
char sz[] = u8″■※”;
p sz
&”p sz\n”
$2 = “â â»”
OK
list
&”list\n”
3 using namespace std;
4
5 int main(int argc, char *argv[])
6 {
7 char sz[] = u8″â â»”;
8 cout << sz << endl; //<================= Put a breakpoint here
9 return 0;
10 }
OK
gdb raw output———————————————————————-
&”list\n”
~”3\tusing namespace std;\n”
~”4\t\n”
~”5\tint main(int argc, char *argv[])\n”
~”6\t{\n”
~”7\t\tchar sz[] = u8\”\342\226\240\342\200\273\”;\n”
~”8\t\tcout << sz << endl;\t//<================= Put a breakpoint here\n”
~”9\t\treturn 0;\n”
~”10\t}\n”
^done
I try to what is “â â»” by notepad++, then I found it should be UTF8 byte stream shown by Latin code page
set to Latin-1 codepage, copy “â â»” to notepad++ and change to UTF8 codepage, we will see “■※”.
so VisualGDB should show gdb stream as utf8, MultibyteToWideChars to wchar_t stream then write to GDB session window.
Please make an update.