Language used by setup-x86_64.exe
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu Jul 24 20:33:43 GMT 2025
On Jul 24 20:12, Jon Turney via Cygwin wrote:
> On 23/07/2025 09:25, Takashi Yano via Cygwin wrote:
> > On Wed, 23 Jul 2025 17:02:22 +0900
> > Takashi Yano wrote:
> > > Recent cygwin setup-x86_64.exe has Japanese translation and
> > > it uses Japanese when it is running in Japanese Windows.
> > >
> > > However, sometimes I would like to setup-x86_64.exe with
> > > English. I tried:
> > > LANG=en_US.UTF-8
> > > LC_ALL=en_US.UTF-8
> > > LANGUAGE=en
> > > however, all of them did not work.
>
> Hmm... yeah, this is not ideal.
>
> setup is just a Windows application, so I don't think the CRT implements
> checking those env vars for the default, it just looks at what the "Windows
> locale" the user has configured.
>
> I guess it would be a good idea to take these env vars into account before
> calling setlocale() to emulate unix-style bahaviour.
>
> > > Is there any way to force setup.exe to use English?
> >
> > setup-x86_64.exe --lang 1033 did not work, but
> > setup-x86_64.exe --lang 0x409 or setup-x86_64.exe --lang 409 works!
> Glad you managed to find the option!
>
> Assuming that the language code is hex seems just wrong though, so I'll
> consider that a bug. Thanks for pointing that out!
Since Vista, Windows supports normal language identifiers
in setlocale. Starting with Windows 10 1803 it also supports ".utf8"
and friends.
The problem is that WinMain calls setlocale() only once before it sets
the languege from --lang and the latter only takes numeric input because
it calls the outdated SetThreadUILanguage().
It should call SetThreadPreferredUILanguages() instead, which also takes
RFC 5646 language identifiers (dash instead of underscore, i.e. "en-US").
Fortunately msvcrt setlocale() supports both forms, with underscore and
with dash.
Corinna
More information about the Cygwin
mailing list