From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23207 invoked by alias); 11 Jun 2014 16:23:10 -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 23193 invoked by uid 89); 11 Jun 2014 16:23:09 -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,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jun 2014 16:23:03 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N7000600IC1ID00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Wed, 11 Jun 2014 19:23:01 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N70006UPIUCM700@a-mtaout20.012.net.il>; Wed, 11 Jun 2014 19:23:01 +0300 (IDT) Date: Wed, 11 Jun 2014 16:23:00 -0000 From: Eli Zaretskii Subject: Re: [ping] [PATCH] Different outputs affected by locale In-reply-to: <5397BCEC.8080300@codesourcery.com> To: Yao Qi Cc: palves@redhat.com, tromey@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <838up3za8t.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> X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00452.txt.bz2 > Date: Wed, 11 Jun 2014 10:20:28 +0800 > From: Yao Qi > CC: Tom Tromey , Joel Brobecker , > > We import setlocale so that we can set locale through env var, assuming > that different locales affect the return value of iswprint (0xa2). > However, this assumption isn't true on Windows :( > > I write the following program to check the return value of iswprint > under different locales. > > On Linux, the output is reasonable > $ ./iswprint > 4 > C: 0 > en_US.UTF-8: 1 > C: 0 > > On Windows, iswprint always return true! > C:\>iswprint.win.exe > 2 > C: 16 > English_United States.1252: 16 > C: 16 > > iswprint return value depends on LC_CTYPE, but under LC_CTYPE=C, > iswprint (0xa2) behaves differently on Windows and Linux. Why do you need 0xa2 to be unprintable?