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

Владимир Мартьянов
2019-04-02T20:08:54Z

пн, 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. 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.