Re: What's the locale for system files (e.g. /etc/fstab)?

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Fri, 25 Mar 2022 08:52:21 UTC
On 25/03/2022 04:08, Warner Losh wrote:
> Right. They are de-facto C.UTC-8, at least at the top level these days.

Of the C.UTF-8 locale, I believe the .UTF-8 bit is the important one. 
The C bit controls collation order (we're not doing locale-aware sorting 
of these files), decimal and thousands separators (not used), and things 
like currency symbols (not important for system files).

I wonder if we should write a UTF-8 BOM to the front of the default 
versions of these files and skip it in things that parse them.  This 
would mean that anyone who opens the file in any unicode-aware editor 
(i.e. pretty-much anything these days) would automatically have the 
correct encoding set.  Whether they're writing with a Japanese, English, 
French, or whatever locale set, the text encoding will be correct and 
the kernel / tools can keep their current assumptions (assuming that we 
explicitly document the separator characters in things like fstab to be 
tabs / spaces and not anything that unicode thinks is whitespace, which 
we do at least for fstab, I didn't check the man pages for any other files).

David