Using UTF-8 as host charset

Paul_Koning@Dell.com Paul_Koning@Dell.com
Mon Mar 5 16:13:00 GMT 2012


While it doesn't use phony iconv, there are some other questions that have come up on this in the past.  NetBSD (and possibly others) have an iconv implementation that doesn't provide the "wchar_t" encoding GDB assumes every iconv will have.  I remember trying to do something about this and running into concerns that wchar_t, formally speaking, is not the same as UCS-2 even though for practical purposes the two are interchangeable.

	paul

-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf Of Mathias Kunter
Sent: Saturday, March 03, 2012 11:34 AM
To: gdb@sourceware.org
Subject: Using UTF-8 as host charset

Dear members of the gdb mailing list,

I'm working on a patch for Eclipse which adds full charset support to the CDT debugger. We're setting gdb's host-charset to UTF-8 to achieve this. There already had been discussion about this back in 2010 here on the gdb mailing list. Tom Tromey said back then - quoted from http://sourceware.org/ml/gdb/2010-08/msg00129.html

 > 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.

So the question is, is it actually a good idea to simply always set gdb's host charset to UTF-8? Which hosts do use the phony iconv, and is it indeed a problem for them if the host charset is UTF-8?

Note that we're only talking about gdb 7.0 or later. We don't plan to support this feature for gdb < 7.0 within CDT.

Thanks for any hints!
Mathias


PS: Just for reference: the corresponding Eclipse bug report can be found at https://bugs.eclipse.org/bugs/show_bug.cgi?id=307311



More information about the Gdb mailing list