From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42374 invoked by alias); 2 Apr 2019 21:10:25 -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 42358 invoked by uid 89); 2 Apr 2019 21:10:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-2.4 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,GARBLED_BODY,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 spammy==d0=b0=d1, env, HContent-Transfer-Encoding:8bit?= X-HELO: rgout05.bt.lon5.cpcloud.co.uk Received: from rgout05.bt.lon5.cpcloud.co.uk (HELO rgout05.bt.lon5.cpcloud.co.uk) (65.20.0.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Apr 2019 21:10:23 +0000 X-OWM-Source-IP: 31.51.207.0 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN Received: from [192.168.1.102] (31.51.207.0) by rgout05.bt.lon5.cpcloud.co.uk (9.0.019.26-1) (authenticated as jonturney@btinternet.com) id 5C24804F09357194; Tue, 2 Apr 2019 22:10:20 +0100 Subject: Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows To: =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?= References: <83mullpwg6.fsf@gnu.org> <83ef6qjdbb.fsf@gnu.org> <838swyjafd.fsf@gnu.org> <837echkgjo.fsf@gnu.org> <8336n3hzkx.fsf@gnu.org> <7041169d-9f64-fcce-2c3c-021dd1858923@dronecode.org.uk> Cc: gdb-patches@sourceware.org From: Jon Turney Message-ID: <2210fef9-10ac-30d6-db97-dede797259b8@dronecode.org.uk> Date: Tue, 02 Apr 2019 21:10:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2019-04/txt/msg00011.txt.bz2 On 02/04/2019 21:57, Владимир Мартьянов wrote: > I'm able to use results from setlocale(), but how can the user > influenсe the result of setlocale? > I wrote i simple program to display it's result: > void main(int argc, char* argv[]) > { > printf("%s\n", setlocale(LC_ALL, 0)); > } > Then I run it from Cygwin console: > $ LC_ALL=en_US /cygdrive/c/Programming/Test/Debug/test.exe > C > $ LC_ALL=de_DE /cygdrive/c/Programming/Test/Debug/test.exe > C > > Changing env. var doesn't affect setlocale() result. This test program isn't correct. You must first call setlocale(LC_ALL, "") to change the locale from the default "C" locale. See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/setlocale.html http://man7.org/linux/man-pages/man3/setlocale.3.html