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

Владимир Мартьянов vilgeforce@gmail.com
Tue Apr 2 20:08:00 GMT 2019


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



More information about the Gdb-patches mailing list