gpt4 book ai didi

c++ - 在gdb tui中打印utf 8符号

转载 作者:太空宇宙 更新时间:2023-11-04 04:07:30 25 4
gpt4 key购买 nike

我在 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++ 命令:

g++ -O0 -g tmp.cpp

gdb 命令:

b 6
r
info locals

gdb 标准输出:

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

gdbtui 标准输出:

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

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

最佳答案

Ctrl + L resolve this situation.

关于c++ - 在gdb tui中打印utf 8符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20599132/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com