Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows

Eli Zaretskii
2019-04-03T04:30:51Z

> From: Ð’Ð»Ð°Ð´Ð¸Ð¼Ð¸Ñ€ ÐœÐ°Ñ€Ñ‚ÑŒÑÐ½Ð¾Ð² <vilgeforce@gmail.com>
> Date: Tue, 2 Apr 2019 23:08:38 +0300
> Cc: gdb-patches@sourceware.org
>
> Ð¿Ð½, 1 Ð°Ð¿Ñ€. 2019 Ð³. Ð² 07:47, Eli Zaretskii <eliz@gnu.org>:
> >
> > > + if (LocaleNameToLCID != NULL)
> > > + {
> > > + MultiByteToWideChar (CP_ACP,
> > > + 0,
> > > + buf,
> > > + -1,
> > > + wbuf,
> > > + COUNTOF (wbuf) - 1);
> > > + lcid = 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.

You are right, it was my mistake. Sorry.