Sujet : Locales [was: Re: Rationale for aligning data on even bytes in a Unix shell file?]
De : flexibeast (at) *nospam* gmail.com (Alexis)
Groupes : comp.lang.cDate : 29. Apr 2025, 11:50:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <877c338cnt.fsf_-_@gmail.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Gnus/5.13 (Gnus v5.13)
Bonita Montero <
Bonita.Montero@gmail.com> writes:
UTF-8 has a locale, the chars between 128 and 255 have the locale Latin 1.
Since, as far as i can tell, no-one else has yet noted this:
The 'locale' includes the part _before_ the '.'. In the output you
shared, the locale is set to "C", the C/POSIX locale, using the UTF-8
'codeset' (i.e. encoding).
In my own case, my locale is en_AU[.UTF-8], the locale for the
English language in Australia:
$ locale
LANG=en_AU.UTF-8
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME=en_AU.UTF-8
...
Informally, when people refer to the 'locale', they're usually talking
about the part before the '.', not the encoding, e.g. "pl_PL" or "es_EH".
The glibc manual has a section that goes into the details:
Most locale names follow XPG syntax and consist of up to four parts:
>
language[_territory[.codeset]][@modifier]
--
https://www.gnu.org/software/libc/manual/html_node/Locale-Names.htmlAlexis.