在gdbtui中打印utf8符号

时间:2013-12-15 20:03:24

标签: c++ linux utf-8 console gdb

我在gdb -tui模式下打印utf8符号时遇到问题。

(gdb) show charset
The host character set is "auto; currently UTF-8".
The target character set is "auto; currently UTF-8".
The target wide character set is "auto; currently UTF-32".

代码:tmp.cpp,utf8

#include <iostream>

int main() {
    char *s = "asd";
    char *w = "тест";
    std::cout << s << std::endl;
    std::cout << w << std::endl;
    return 0;
}

g ++ cmds:

g++ -O0 -g tmp.cpp

gdb cmds:

b 6
r
info locals

gdb stdout:

s = 0x80487b0 "asd"
w = 0x80487b4 "тест"

gdbtui stdout:

s = 0x80487b0 "asd"
w = 0x80487b4 "мама"

请告诉我,我该怎么做才能看到正确的输出?

1 个答案:

答案 0 :(得分:0)

Ctrl + L resolve this situation.