This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows
- From: Владимир Мартьянов <vilgeforce at gmail dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 2 Apr 2019 23:08:38 +0300
- Subject: Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows
- References: <CAL5iTPJO-WLB8a07+K_aE4fkDkr8kPewkm9wPtuYDGnkq8bWrg@mail.gmail.com> <83mullpwg6.fsf@gnu.org> <CAL5iTP+hJE6x2gk3Q3N_ikJdr-ie62vG4HwKCZCfX0HnZwyZFw@mail.gmail.com> <83ef6qjdbb.fsf@gnu.org> <CAL5iTPJr_-WxFcCSFdq_CEoBHuq22FVr55aA1WQisO9DPiEv2w@mail.gmail.com> <838swyjafd.fsf@gnu.org> <CAL5iTPJD77ML8=2uM_dc63QCSHtKrgQTZe2MQbPUoo=veAYJ3A@mail.gmail.com> <837echkgjo.fsf@gnu.org> <CAL5iTP+_iZwf+NyMXM8+xRUd4H8ibSSvTKF=e8HrQ+MbJDfv1g@mail.gmail.com> <8336n3hzkx.fsf@gnu.org> <CAL5iTP+7snxFyw4B8bfBNJtfy+B3p3kSCfdQcChmkw+gwrN5eA@mail.gmail.com> <83bm1qgwm2.fsf@gnu.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. 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.