delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/20/12:03:52

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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=rmgaVxN1u5ptXJbHbqqX5qEqRrEIXv4i9oRIe2+Xx19EakoipjsCM
FnYGGISfPtC9S0E7qcMXX48zZcG6QNKOrdvUq5YUqjD+HP6qtf/Nhe4KXO9LNVl9
3cpOLGMVxVbkueDrRyFhkmtKat+Jz9I56KU5uHFnno0SL7O2JxrfSg=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=/5DYYzH+/eEio7IcleliNXaiIh8=; b=SGagMTxgG+EWkEbrbgQTbOJaSypV
5eiqtsfqjz8z7uI3DmHeQYX/WTqw7d4nVrY9VuAsXvcyrgGA1ZqNW1GSgn0b+9JI
Rwq49jQY58fhki1lErY0a8QhRbdEM7Dq9wI/r4zTKKtN9XVeNxbvXXGSjNlZp3d2
n8A8YyrDqE+h4Hc=
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=-95.1 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=Lets, Let's, setlocale, H*i:sk:1a875d2
X-HELO: calimero.vinschen.de
Date: Sat, 20 Aug 2016 18:03:20 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.9
Message-ID: <20160820160320.73ojakypt2cqhrum@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 20160819153151 DOT kezwphgmthqgl6ll AT calimero DOT vinschen DOT de> <1a875d23-ae88-a1e1-82e8-69400b0dd79b AT SystematicSw DOT ab DOT ca>
MIME-Version: 1.0
In-Reply-To: <1a875d23-ae88-a1e1-82e8-69400b0dd79b@SystematicSw.ab.ca>
User-Agent: Mutt/1.6.2-neo (2016-07-23)

--d2p5y7d2qli5w2gw
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Brian,

On Aug 19 13:06, Brian Inglis wrote:
> On 2016-08-19 09:31, Corinna Vinschen wrote:
> > I uploaded a new Cygwin test release 2.6.0-0.9.
> > The 2.6.0 release is going to introducing the locale_t datatype, as well
> > as all functions related to locale_t locales and per-thread locales per
> > POSIX-1.2008.
> > The full list of new interfaces is:
> >   isalnum_l, isalpha_l, *isascii_l*, isblank_l, iscntrl_l, isdigit_l,
> >   *toascii_l*, tolower_l, toupper_l, towctrans_l, towlower_l, towupper_=
l,
>=20
> Macros/functions isascii_l(3) and toascii_l(3) are not in POSIX,

Right, they are GNU extensions and marked as such in the headers.  But
you're right, I should have been more clear in the release message as to
which functions are POSIX and which ones are GNU extensions.

> and isascii(3) and toascii(3) are deprecated:
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html

Right, and the feature test macros in ctype.h say so:

  #if __MISC_VISIBLE || __XSI_VISIBLE
  int _EXFUN(isascii, (int __c));
  int _EXFUN(toascii, (int __c));
  [...]
  #endif

> nl_langinfo_l(3) is in POSIX and is not included in your list:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/nl_langinfo.html

Right, thanks for pointing this out.  Oh well, I searched the POSIX
function list *at least* twice and simply didn't see this function.
I hope I didn't miss another one.

This will be rectified in the next test release which I'm going to
upload in a sec.

> Will LC_GLOBAL_LOCALE designate the locale -f or locale -n locale?

Neither.  LC_GLOBAL_LOCALE is a per process locale and per POSIX the
default is to set it to the "C" locale at process startup.  A POSIX
compliant application has to call setlocale(3) to change its locale
process-wide.

locale -f or locale -n are really only fetching information from Windows
when you call the tool, but the underlying WIndows functions are never
directly used by the Cygwin DLL.

You *can* use them to prime your locale-specific environment variables,
but that's all.  Cygwin applications default to the "C" locale, or to
the locales set via the LANG/LC_xxx variables *if* the application calls
setlocale(LC_ALL, NULL);

> locale -s and locale -u appear to return the Windows default product
> locale e.g. en_US, regardless of system default regional settings.

Not quite.  Let's have a look into the locale(1) options:

-i returns the current "input" language.  That's what you set in the
region&language settings and by choosing a locale for input in the
keyboard layout control.  This is often what you really want, but we
only found out about this a couple of days ago when we had a system with
-u persisting to return the wrong info.

-s and -u are a bit tricky.  Both depend on the installed language packs
which you can download from Microsoft.  If you didn't install another
language pack, then the *only* language ever returned by -s and -u will
be the language you installed the OS with in the first place.  Download
langauge packs and this gets settable, the -s option only by an admin,
of course.

-f is equivalent to the langauge you set the "Format" settings to, i. e.
the settings for date, time, monetary...

And last but not least -n is the locale used for applications which are
not UNICODE capable.  This affects the Windows API but it's not used by
Cygwin.


Thanks,
Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--d2p5y7d2qli5w2gw
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXuH9IAAoJEPU2Bp2uRE+glrwP/A1H4SjRPodAXToxosasBdFl
3gVNOILHqH2iOP2UNC7pWHfvsraS+wnxQWGUyLI+ya9JbKHoeFGP5E1GSevawS5t
tDr36DbuWHgo9eirkNeSC6dOcHrX+jkhdc0mSZif5omdADGjNuEj+bvSaDegOdJk
V19Lc+28TVD+I/ppUvVgxfL9yXN6wttYG0WgSWHwH/TGObVZ+y/a7pgUsi2Wrvke
5289QLsKV9LgvZZ0lk/qN7PNOCeRhiUci1dyesAk/Xu1ZJoHgqyBboku7YmaNWNa
mbU2DRI11twtPZbDpfzwbA10529nyAzh4D0AjYEQ6p1u6VTlZKEdzlKPsFViyTpI
KHlDe2lLB9cHHzamR+JVzPa7fZrKAyRnHjNiYcIOPrD9mIf8p8KAqFd/rPenmQ5m
JHkfv6bPTi6TjNhXCkBcHowUBXsTYMYnpcm9/wV+27KepZB25irXk0otuhrJVeK+
VhY84jF2e9QEBfpfJKb2FEAZ93dG7vEd9P0VD1uJ4s19fzqGltU+DnhjQ0wpS/N/
WMN6wxeB+fLk0mJiuGTlmST+c2bKVLYUCnav/jpglq7osY8tSUed9a1AF1UZOakn
usSWuehsZTwOD5+1mWqG0uIpTYVVN2nYRuKWXexHb9shRMufb0pt5mEejl4lriGc
FlkWJZpMXkKtRDwHLWg7
=8jN3
-----END PGP SIGNATURE-----

--d2p5y7d2qli5w2gw--

- Raw text -


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