From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123529 invoked by alias); 2 Apr 2019 20:08:54 -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 123520 invoked by uid 89); 2 Apr 2019 20:08:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_EXCESS_BASE64,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=Zaretskii, eliz@gnu.org, zaretskii, HX-Languages-Length:961 X-HELO: mail-ua1-f43.google.com Received: from mail-ua1-f43.google.com (HELO mail-ua1-f43.google.com) (209.85.222.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Apr 2019 20:08:53 +0000 Received: by mail-ua1-f43.google.com with SMTP id c13so4826174uao.12 for ; Tue, 02 Apr 2019 13:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3rwedf3xffYTnf6V1jB89vz5vnumVa1j/ITQXJr0RVU=; b=sqRzNMiMVNE0U2ViI1F4rwghTijoLq6uMOMzQObOjjBAOQ9TPkdhw++IhNldSEj1DW rKIiGBRXnOSYrzzGrthkjKr1/ki31maDO8MTcY+H3qjLWX987LRbuubk06pMPPMEaGjU Hs2LEuHHmDoaA7DwFznH70MEoNgFennjVC3ROodV3OL9iBSI8awgYOw8ObJckzm5C5c9 czcE0gaFN0fJIjpdgCILS2uMrGqdV+RtVFxcaLSsQmaH/ntFT4ynQ3SjpE6YOfEVCDb1 JBCtrQhtsQZGmqEvKilOvahYNMdVdLwc44xij/iApDBq9Q6XeNXXx+MhXYI7wxCJjfC9 DU+A== MIME-Version: 1.0 References: <83mullpwg6.fsf@gnu.org> <83ef6qjdbb.fsf@gnu.org> <838swyjafd.fsf@gnu.org> <837echkgjo.fsf@gnu.org> <8336n3hzkx.fsf@gnu.org> <83bm1qgwm2.fsf@gnu.org> In-Reply-To: <83bm1qgwm2.fsf@gnu.org> From: =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?= Date: Tue, 02 Apr 2019 20:08:00 -0000 Message-ID: Subject: Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows To: Eli Zaretskii Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-04/txt/msg00009.txt.bz2 =D0=BF=D0=BD, 1 =D0=B0=D0=BF=D1=80. 2019 =D0=B3. =D0=B2 07:47, Eli Zaretski= i : > > > + if (LocaleNameToLCID !=3D NULL) > > + { > > + MultiByteToWideChar (CP_ACP, > > + 0, > > + buf, > > + -1, > > + wbuf, > > + COUNTOF (wbuf) - 1); > > + lcid =3D LocaleNameToLCID (wbuf, 0); > > This assumes that the code is compiled with UNICODE defined, which > will then call LocaleNameToLCIDW. But the code in question is common > to Cygwin and MinGW compilations, and the latter defaults to UNICODE > undefined. So I think you need to call LocaleNameToLCIDW explicitly > here. Unfortunately, there is no LocaleNameToLCIDA and LocaleNameToLCIDW, there is only LocaleNameToLCID which accept widechar strings only. At least, I'm not able to find LocaleNameToLCIDA or LocaleNameToLCIDW in MSDN or in kernel32.dll exports. That's the reason I used not recommended Rfc1766ToLcid function.