UTF-8 not working for MI?

Marc Khouzam marc.khouzam@ericsson.com
Fri Aug 27 15:21:00 GMT 2010

> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com] 
> Sent: Friday, August 20, 2010 2:51 PM
> To: Marc Khouzam
> Cc: 'gdb@sourceware.org'
> Subject: Re: UTF-8 not working for MI?

Sorry for the delay.

> >>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:
> Marc> Or maybe using "interpreter-exec mi" does not quite 
> give the true
> Marc> MI interpreter?
> I dug harder and found this:
> static void
> mi_command_loop (int mi_version)
> {
>   /* Turn off 8 bit strings in quoted output.  Any character with the
>      high bit set is printed using C's octal format. */
>   sevenbit_strings = 1;
> So, you can reproduce this situation from the CLI by "set print
> sevenbit-strings on" before invoking the MI command.
> It is an oddity that currently an MI consumer must check gdb's host
> charset in order to know how to decode its output.  I would recommend
> that the client force it to be UTF-8, but I think this 
> currently may not work with PHONY_ICONV.

Thanks for taking the time!
I'm not sure how PHONY_ICONV works, but I'm guessing you meant
that it may cause trouble when GDB is used from Eclipse.

I just tried using "set print sevenbit-strings off" in Eclipse
I can see the proper UTF-8 characters returned by GDB.  So it seems
like a good solution.

I'd like to use this solution but I'm concerned at why MI conciously
uses sevenbit-strings?  Maybe there is a reason behind it and I'm going
to shoot myself in the foot by ignoring it?



More information about the Gdb mailing list