Date: Fri, 25 Mar 2022 08:52:21 +0000 From: David Chisnall <theraven@FreeBSD.org> To: freebsd-hackers@freebsd.org Subject: Re: What's the locale for system files (e.g. /etc/fstab)? Message-ID: <27c92ee9-a4e2-ce6d-16b0-f0cef2961520@FreeBSD.org> In-Reply-To: <CANCZdfrJhva3sgm6HnZbYrvGs90R-sJWJPfuZfT0C3Ozzz37Hg@mail.gmail.com> References: <70B211BB-15BA-47A4-8F9C-C833AA8C1EAA@freebsd.org> <202203241519.22OFJ3Mk098649@gndrsh.dnsmgr.net> <CANCZdfp1oJdC2HfU63U_3y4y%2BQE0TswdVSg%2Big4uS3RJC3yK3w@mail.gmail.com> <71356.1648139436@kaos.jnpr.net> <CANCZdfrZjeU_%2BLRew9BOCdktDi3aTUoeEaBkrov9FccvwfaN0g@mail.gmail.com> <EC99D2B8-769D-46BA-AF87-7B48D90E70D1@juniper.net> <CANCZdfrJhva3sgm6HnZbYrvGs90R-sJWJPfuZfT0C3Ozzz37Hg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?27c92ee9-a4e2-ce6d-16b0-f0cef2961520>