DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 56OKY9EO1608499
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 56OKY9EO1608499
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=elnrVWzB
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62FD1385C426
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1753389247;
	bh=JMq0bNc0qfj7wtpA4etgyGdSONrfFW177zCNWSjJmf4=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=elnrVWzBbSq2XyP1XtDmVhfKAM7wXOa0sYc8Z0jI3xXH1Um4Qsbv3lvavEnf4KoYq
	 kCi9wUB6SHglv8Mf0KjPkvaeWeDhpnlaBD4zNI6aD9X4ruhZniLlLkeIp5woKPamfm
	 9SvCw8WEMlImgnoaSCiYBrd1SJTckON9SskBYNS0=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DBD9385B83D
Date: Thu, 24 Jul 2025 22:33:43 +0200
To: cygwin@cygwin.com
Subject: Re: Language used by setup-x86_64.exe
Message-ID: <aIKYp7ZQmRvqAIjR@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <20250723170222.884d341b6030a21b621d4145@nifty.ne.jp>
 <20250723172518.26cdb41e4edc69a97d4debd0@nifty.ne.jp>
 <e5ebc242-4ccb-4932-b7c0-8555d096d413@dronecode.org.uk>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e5ebc242-4ccb-4932-b7c0-8555d096d413@dronecode.org.uk>
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
