源码中的注释:“// 类型宽度”在gdb调试的时候显示成“// 绫诲~^~K瀹藉害”,请问如何设置才能正确显示汉字?我的终端是redhat自带的,设置的编码方式是utf8,要调试的代码文件格式是:UTF-8 Unicode C program text,在vim中显示,编辑汉字都没问题
10 个解决方案
#1
what's ur current charset in gdb?
(gdb)show target-charset
To display the list of supported target character sets, type
(gdb)set target-charset TABTAB.
#2
(gdb)set charset charset
Set the current host and target character sets to charset. As above, if you type set charset TABTAB, GDB will list the names of the character sets that can be used for both host and target.
Well, I guess I am luck that I don't have to deal with locale and all these encoding things...
#7
export LANG=相应的语言
#8
调整终端的编码格式,应该跟gdb的没啥关系
#9
调整终端的编码格式,应该跟gdb的没啥关系
同意楼上的
#10
Don't let Chinese appear in your code!!!
#1
what's ur current charset in gdb?
(gdb)show target-charset
To display the list of supported target character sets, type
(gdb)set target-charset TABTAB.
#2
(gdb)set charset charset
Set the current host and target character sets to charset. As above, if you type set charset TABTAB, GDB will list the names of the character sets that can be used for both host and target.