Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Displaying UTF8 strings in gdb inside Emacs



A co-worker is running into an issue displaying UTF8 (Japanese)
strings in a C program in gdb running under Emacs. Doing a 'p
some_struct->some_string' displayed garbage, but I assumed it was
because gdb was treating it as a C string, one character per byte,
NULL-terminated.

So we tried setting LC_ALL=ja_JP.UTF8, re-running gdb, and then doing
a 'printf "%s", some_struct->some_string'. Sure enough, that worked.

But trying the same trick in Emacs's (GNUmacs, sorry, I can't get this
guy to switch to a *real* Emacs flavour) gdb mode did not work. We
started Emacs like so:

LC_ALL=ja_JP.UTF8 LANG=ja_JP.UTF8 emacs
M-x gdb

Any clues why this is not working? We are using Emacs in console mode,
BTW. X mode is not an option, because X forwarding over SSH is too
slow.

-Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links