From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23040 invoked by alias); 16 Jun 2014 15:40:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23025 invoked by uid 89); 16 Jun 2014 15:40:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout25.012.net.il Received: from mtaout25.012.net.il (HELO mtaout25.012.net.il) (80.179.55.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Jun 2014 15:40:43 +0000 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N7900700PR5HZ00@mtaout25.012.net.il> for gdb-patches@sourceware.org; Mon, 16 Jun 2014 18:36:56 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N79007KKQ1KQQ10@mtaout25.012.net.il>; Mon, 16 Jun 2014 18:36:56 +0300 (IDT) Date: Mon, 16 Jun 2014 15:40:00 -0000 From: Eli Zaretskii Subject: Re: [ping] [PATCH] Different outputs affected by locale In-reply-to: <539EF7E7.7020204@redhat.com> To: Pedro Alves Cc: yao@codesourcery.com, tromey@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83fvj4vp56.fsf@gnu.org> References: <1401192650-29688-1-git-send-email-yao@codesourcery.com> <538EAEE5.2080708@codesourcery.com> <20140604124708.GR4289@adacore.com> <538F1CC3.9090605@codesourcery.com> <87oay8a0t6.fsf@fleche.redhat.com> <538F803A.9020007@redhat.com> <538FE412.1050806@codesourcery.com> <53903119.6000204@redhat.com> <53903EE5.8090107@codesourcery.com> <539042A2.4050409@redhat.com> <539571C6.40605@codesourcery.com> <53958862.5020106@redhat.com> <5397BCEC.8080300@codesourcery.com> <539990BD.9020504@redhat.com> <83tx7qxdg6.fsf@gnu.org> <5399E2D7.3060705@redhat.com> <83ioo6xbk2.fsf@gnu.org> <5399EC00.4000601@redhat.com> <83egyux9h2.fsf@gnu.org> <539EF7E7.7020204@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00558.txt.bz2 > Date: Mon, 16 Jun 2014 14:57:59 +0100 > From: Pedro Alves > 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).