delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/12/24/10:42:30

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:mime-version:to
:subject:content-type; q=dns; s=default; b=tM2foxZzamqeCT7dUOHvR
1ZojufV9Ik51skOwt2dT1yn6H5WW6yYEElqMw7uTZwWvm8ukf6d26MujZHmK4DEC
I4uzTDjIgxT9dLc5O4WI+75dJIK9pLMtzYT0JwcDF5pegB1oNtw7MNOjgy83zYFk
mHqk/AHl0H1S5VVxjnJLVg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:mime-version:to
:subject:content-type; s=default; bh=FBvn5HS60fmgaUdxB2akdxmSQAQ
=; b=PlR5LGVwKbpMqxxHyrjdI5MOFY/EU/FuPgfGt2b4SZQf/MVmEGVPTONV0Ht
QVXKr8iWFauEWk+S1SufcP5kfvURTWuhEW9MA+4TQYsXj+Po723D0npONBW/pih8
Ml+an8iSa0HLkMyOLu8ga1Mub8sqLULmYVmT3KWFZ49ZDFxs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=russia, Russia, regional, 81
X-HELO: mail-lf0-f44.google.com
X-Received: by 10.25.91.210 with SMTP id p201mr12798320lfb.37.1450971657324; Thu, 24 Dec 2015 07:40:57 -0800 (PST)
Message-ID: <567C1207.3020700@gmail.com>
Date: Thu, 24 Dec 2015 18:40:55 +0300
From: "Andrey ``Bass'' Shcheglov" <andrewbass AT gmail DOT com>
Reply-To: andrewbass AT gmail DOT com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Default locale for Russian/Russia should be ru_RU.CP1251
X-IsSubscribed: yes

--------------ms000307010906090901060707
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

Hi,

I'm running Cygwin 2.2.0 on an English Windows 8.1 box:

> CYGWIN_NT-6.3 UNIT-725 2.2.0(0.289/5/3) 2015-08-03 12:51 x86_64 Cygwin

Windows regional settings are set to Russian/Russia.

In the absence of any settings in bashrc/bash_profile, `locale` command
outputs the following:

> LANG=3Dru_RU
> LC_CTYPE=3D"ru_RU"
> LC_NUMERIC=3D"ru_RU"
> LC_TIME=3D"ru_RU"
> LC_COLLATE=3D"ru_RU"
> LC_MONETARY=3D"ru_RU"
> LC_MESSAGES=3D"ru_RU"
> LC_ALL=3D

This is perfectly fine, except that "no charset" in the locale output
means "ISO charset", which is ISO-8859-5 for Russian/Russia and has
never been used (historically, DOS used CP866, Windows used CP1251 ANSI
codepage, and various Unices sticked to KOI8-R before the rise of
Unicode era).

The above is consistent with locale charmap output, which is again
ISO-8859-5.


Short C example also confirms ISO-8859-5 is used:

> #include <stdio.h>
>=20
> #include <locale.h>
> #include <langinfo.h>
>=20
> int main() {
>     const char *locale =3D setlocale(LC_ALL, "");
>     const char *codeset =3D nl_langinfo(CODESET);
>     printf("locale: %s\n", locale);
>     printf("codeset: %s\n", codeset);
>=20
>     return 0;
> }

outputs

> locale: ru_RU/ru_RU/ru_RU/ru_RU/ru_RU/C
> codeset: ISO-8859-5


Cygwin docs state that

> Starting with Cygwin 1.7.2, the default character set is determined by th=
e default Windows ANSI codepage for this language and territory.

which is not true in my case (Windows ANSI codepage for Cyrillic is
CP1251, not ISO-8859-5!). Surprisingly, for Belarusian (a.k.a
Belorussian, Eastern Slavic language very close to Russian) "be_BY"
locale the default charset is indeed CP1251 which is in accordance with
both the documentation and common sense.


Additionally, in `strace locale -u` output, I see multiple
> __get_lcid_from_locale: LCID=3D0x0419=20
lines.

"0x0419" corresponds to Russian/Russia (see
<https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693%28v=3Dvs=
.85%29.aspx?f=3D255&MSPPError=3D-2147217396>).

Despite that, $(locale -u) returns "en_GB", despite all regional
settings are set to Russian/Russia. I believe this is not correct,
either, and needs to be fixed.


Regards,
Andrey.


--------------ms000307010906090901060707
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG
9w0BBwEAAKCCCfYwggSvMIIDl6ADAgECAhEA4CPLFRKDU4mtYW56VGdrITAN
BgkqhkiG9w0BAQsFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1
c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3Jr
MSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTE0MTIy
MjAwMDAwMFoXDTIwMDUzMDEwNDgzOFowgZsxCzAJBgNVBAYTAkdCMRswGQYD
VQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAY
BgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMUEwPwYDVQQDEzhDT01P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pSptLVQBAIvGUiWkf
joeB+Cxnt0a+HwKWIVExbdOOjQP0Hj5961UkEo29d8J3jH700cF/zy4crxKl
0F5nW9heec/YLfr626XAfo554vM0hHPTVyJ+EBWbv8VoRdNwNFebm2CRrXKR
ePiSSMI/RVbpSdrJKbB06QIu/jRJQFOlll8O7kDvXikRN3PlqWPLjDIbwDvN
yIxj1PDezaVl7mGDweuJdJK1wV5ycbsvA48h1ZkvhDus0k3wfA06g0OboGZ6
NL+XG4KcNAJZAAAAAAAA

--------------ms000307010906090901060707--

- Raw text -


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