delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/21/06:26:47

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4ALBQksP4034849
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 4ALBQksP4034849
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=bT5B3LnW
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1BD23857733
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1732188404;
bh=b5aeZ1D4nqdapca9Sx8+RVKMtND5PBhAVrtRl52i0FI=;
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=bT5B3LnWzcysMWQf2ok2VB4oI2SVg5Bh0q+Ja28Yny49p/38Ijv0VL+C0O61qH8/D
mKE348VlJ50LcoJOe7ptynwZxdBx8dEgmgsf1dPLO2ninTDyxh3s8DzUeYsYpTN3gA
KZ+TsjB+819tMjUDpbde9Qp/SjKUGIPX99i36KD4=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65C963858414
Date: Thu, 21 Nov 2024 12:25:39 +0100
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin zh_CN.GB18030 locale?
Message-ID: <Zz8Ys33H2uAF_xzy@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAAvCNcC+Pu=4vXoOR2y_JksDcLwULuQOxS175pv7xCMc03GO1Q AT mail DOT gmail DOT com>
<20241121130620 DOT 01037ce19f7a5025d0e37b81 AT nifty DOT ne DOT jp>
<CAAvCNcBGr5Piv9yB2YoaNNFFG0Q06Eu3Ucuc1YhyhFwyy8vGhA AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAAvCNcBGr5Piv9yB2YoaNNFFG0Q06Eu3Ucuc1YhyhFwyy8vGhA@mail.gmail.com>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 4ALBQksP4034849

On Nov 21 05:57, Dan Shelton via Cygwin wrote:
> On Thu, 21 Nov 2024 at 05:06, Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp> wrote:
> >
> > On Thu, 21 Nov 2024 00:16:41 +0100
> > Dan Shelton wrote:
> > > Does Cygwin have a zh_CN.GB18030 locale?
> >
> > I think so.
> >
> > $ locale
> > LANG=zh_CN DOT GB18030 AT cjknarrow
> > LC_CTYPE="zh_CN DOT GB18030 AT cjknarrow"
> > LC_NUMERIC="zh_CN DOT GB18030 AT cjknarrow"
> > LC_TIME="zh_CN DOT GB18030 AT cjknarrow"
> > LC_COLLATE="zh_CN DOT GB18030 AT cjknarrow"
> > LC_MONETARY="zh_CN DOT GB18030 AT cjknarrow"
> > LC_MESSAGES="zh_CN DOT GB18030 AT cjknarrow"
> > LC_ALL=
> > $ cp
> > cp: 缺少了文件操作数
> > 请尝试执行 "cp --help" 来获取更多信息。
> >
> > (maybe garbled due to my mailer)
> 
> Looks good, except that on Win10 Enterprise Cygwin 3.5.4 locale -a says:
> locale -a | grep 18030

You're confusing locale with codeset (or charset).

  $ locale -a | grep zh_CN
  zh_CN
  zh_CN.utf8
  zh_CN DOT utf8 AT cjknarrow
  zh_CN AT cjknarrow

  $ locale -m | grep 18030
  GB18030

Note that for compat reasons, the default codeset of zh_CN is gb2312,
so you have to specify a different codeset explicitely.

  export LC_MESSAGES=zh_CN.GB18030

But keep in mind that this isn't a safe bet for messages.  An
application also has to support this combination!  Also, Cygwin does not
support localized error strings for POSIX errno values (yet?).

On Nov 21 09:36, Thomas Wolff via Cygwin wrote:
> As cygwin (unlike the restrictive Linux locale system) allows flexible
> combination of all language indication (before the dot) with all codeset
> indications (after the dot), listing them all would be very very long.

Pretty much like this, yes.

> I don't know the criteria by which cygwin lists locales.

It lists the default combinations in conjunction with various modifiers.
The suported modifiers are only attached to languages where they make
sense.

The Windows locales use a slightly different notation than POSIX.  The
function format_proc_locale_proc() in winsup/cygwin/fhandler/proc.cc
converts the strings to POSIX convention and translates them into
Linux-compatible strings, if the Windows and Linux language specifiers
disagree.

For instance, Windows "zgh-Tfng-MA" locale translates to "ber_MA" on
Linux/Cygwin, Windows "tzm-Latn-DZ" translates to "ber_DZ", all other
combinations with "zgh" and "tzm" are suppressed.

Windows also uses different default settings in some languages.  For
instance, for the serbian language, Windows defaults to latin, Linux
defaults to cyrillic.  Cygwin supports the language specification as on
Linux,

For instance, "sr_RS" defaults to cyrillic, while "sr_RS AT latin" uses the
latin script.

Basically Cygwin allows most locales supported by Windows, but the role
model is Linux.  That means that some combination are suppressed, but
these are very few.

There's also locale info which is not supported on Windows at all.
These are the LC_MESSAGES strings and the LC_TIME Era strings.  Those
are taken from Linux, so only the matching info available on Linux is
supported, otherwise we fall back to the C" locale.

It's quite a bit of tweaking.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019