Sujet : Re: Rationale for aligning data on even bytes in a Unix shell file?
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 29. Apr 2025, 09:36:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vuq32j$1ca4v$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 29/04/2025 01:24, Richard Heathfield wrote:
On 28/04/2025 22:26, Bonita Montero wrote:
Am 28.04.2025 um 20:47 schrieb Richard Harnden:
On 28/04/2025 19:36, Bonita Montero wrote:
Am 28.04.2025 um 18:59 schrieb Scott Lurndal:
>
Not really. UTF-8 is UTF-8, regardless of the locale.
>
But UTF-8 isn't the standard locale for Unix filesystems
except with macOS.
>
>
UTF-8 isn't a locale - it's an encoding.
>
Idiot.
Type "locale" in the shell and thenn return.
As David knows and you apparently don't, UTF-8 is an encoding, not a locale.
Which "David" are you referring to here? If it is me, then yes, I know UTF-8 is an encoding and not a locale. I even knew that before Richard Harnden wrote it in the post you quoted :-)
But it is also true that the character encoding is often specified as part of the locale information. That is used when determining the codes for characters typed at the keyboard, and conversely for converting codes into characters for display. I think most people who use Linux and who use characters beyond ASCII will use a locale with UTF-8 encoding. There might be some English-only speakers who use a locale with ISO-8859-1 or ISO-8859-15, as well as some legacy users of other encodings, some specialist users, and on servers the encoding is typically irrelevant.
Filesystems on *nix, and most of the rest of *nix systems, do not care about encoding - they just deal with a string of bytes, which is obviously the correct way to handle them. Windows only needs locale-aware filesystems and filesystem APIs because MS made the mistake of using case-insensitive filesystems in their early days, and are stuck with that.
If you must call people idiots, it's probably wisest to make sure first that you're on solid ground.