This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [ping] [PATCH] Different outputs affected by locale
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: yao at codesourcery dot com, tromey at redhat dot com, brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Mon, 16 Jun 2014 18:40:37 +0300
- Subject: Re: [ping] [PATCH] Different outputs affected by locale
- Authentication-results: sourceware.org; auth=none
- References: <1401192650-29688-1-git-send-email-yao at codesourcery dot com> <538EAEE5 dot 2080708 at codesourcery dot com> <20140604124708 dot GR4289 at adacore dot com> <538F1CC3 dot 9090605 at codesourcery dot com> <87oay8a0t6 dot fsf at fleche dot redhat dot com> <538F803A dot 9020007 at redhat dot com> <538FE412 dot 1050806 at codesourcery dot com> <53903119 dot 6000204 at redhat dot com> <53903EE5 dot 8090107 at codesourcery dot com> <539042A2 dot 4050409 at redhat dot com> <539571C6 dot 40605 at codesourcery dot com> <53958862 dot 5020106 at redhat dot com> <5397BCEC dot 8080300 at codesourcery dot com> <539990BD dot 9020504 at redhat dot com> <83tx7qxdg6 dot fsf at gnu dot org> <5399E2D7 dot 3060705 at redhat dot com> <83ioo6xbk2 dot fsf at gnu dot org> <5399EC00 dot 4000601 at redhat dot com> <83egyux9h2 dot fsf at gnu dot org> <539EF7E7 dot 7020204 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 16 Jun 2014 14:57:59 +0100
> From: Pedro Alves <palves@redhat.com>
> CC: yao@codesourcery.com, tromey@redhat.com, brobecker@adacore.com,
> gdb-patches@sourceware.org
>
> On 06/12/2014 07:34 PM, Eli Zaretskii wrote:
>
> > With you so far. But note that on Windows, even the above does not
> > guarantee "stable output", because the console codepage is not changed
> > by 'setlocale',
>
> I guess the harmness could run gdb under chcp 65001 or some such.
You could, but it won't help, really. It's a long story, but support
for UTF-8 on a Windows console is pathetic. With enough trouble
(which will need source changes in GDB and in Readline), you might
have European characters displayed correctly, if you also change the
console font to Lucida Console. But anything beyond European
characters simply cannot be displayed, because the font doesn't have
them.
> > You cannot ask the Windows 'setlocale' to use UTF-8 as the codeset
> > (although there is a UTF-8 codepage, and Windows does support it in
> > general). More importantly, since 'setlocale' on Windows disregards
> > the environment variables, you cannot change the host charset by
> > setting environment variables. You must do that by a GDB command that
> > sets host-charset.
>
> See https://sourceware.org/ml/gdb-patches/2014-06/msg00364.html .
If you mean the last 2 sentences, then yes, using setlocale from
gnulib will fix that. But the problem with UTF-8 as the charset isn't
(and AFAIK cannot be) solved by gnulib, because Windows simply does
not support codepage 65001 in its setlocale implementation (this is
documented in MSDN).