From nobody Fri Mar 25 08:52:21 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 603641A2DFF9 for ; Fri, 25 Mar 2022 08:52:23 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KPwnz2Fflz3NRQ for ; Fri, 25 Mar 2022 08:52:23 +0000 (UTC) (envelope-from theraven@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648198343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zYPBtTLZHS1abWf9axuyzsfXct/vH4KIL+OiRub/UXw=; b=CCQ2Ux9hF1scHBIk8N0TlrMaHiMrvGtbMmhYLUxVjjgLn8K+LmvEJshWJitAfBfcIzByfA OCPZUP6tXDDBjeHKWclrHSoFNbLjB7eRLil88GYwPUucsSgFc6yNxUO5n3Ulw0x/Wf1wXR Fg0LrMIXXQlhGu5l5GGMk7ZCFOkkpDcViY+RErKAZunAjRMWq7Jq+qgowsGNwF+XngBEjr HKXf2qMbYbr12wgkIMxFwX5HBNNyzATwRfgJ+xBw2Tju/F82mP9BgSE9PUTXQLuxO8jFh0 KkIt9oZlsvia6hCS5mEnPTg7L6kc7pRNhm0XKy81AflEF113n+TOaXdy3A9dWg== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 2E783AE2F for ; Fri, 25 Mar 2022 08:52:23 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.202] (host86-134-184-31.range86-134.btcentralplus.com [86.134.184.31]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 6D72F2F6DE for ; Fri, 25 Mar 2022 08:52:22 +0000 (GMT) Message-ID: <27c92ee9-a4e2-ce6d-16b0-f0cef2961520@FreeBSD.org> Date: Fri, 25 Mar 2022 08:52:21 +0000 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: What's the locale for system files (e.g. /etc/fstab)? Content-Language: en-GB To: freebsd-hackers@freebsd.org References: <70B211BB-15BA-47A4-8F9C-C833AA8C1EAA@freebsd.org> <202203241519.22OFJ3Mk098649@gndrsh.dnsmgr.net> <71356.1648139436@kaos.jnpr.net> From: David Chisnall In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648198343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zYPBtTLZHS1abWf9axuyzsfXct/vH4KIL+OiRub/UXw=; b=ak3njJ6RxYLHAP8zPExYexin/RbcQ/Dv39HVCW2wlLM48FqrHlZ6rZSqSchFHLzMnQcVpQ VsOK2edR8C1OVJ78qfiGopem2/MBbrohrgNPjWd7763DpHxTsBhwdwxx99eqM5L+KsYhhM srZIrWRlbEb0gaeLPiGSlRC3H83hi8fpwRF+u9a0CCn1vh9wIgPUtmFhlES+4TQbaHWWzf n+epqaQrqpgFWnwtDvnefY9YkqOY8PW8spoty03QyFtXoM1XjLAnNDEfmZ9UHKkGi6s1yY KTDMtPgtFLgTh4F8RuJiF/qkao8DM6YMdU4XbZc98QDW9tlV29eYgfw4aP1x2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648198343; a=rsa-sha256; cv=none; b=fxpgZ8qrLFdmjY1FCOeXwe8jSCj7fFYrcQ43YrPM9vc/TUBfOAYVRArNc7spZrTyX7zeJV uLaGYDPDX0YJ0T+5bej81I7Ek63V+RWk+w2D8dsg3j2Ym9AwxQ3KGlZZzn1M8dkUIO04o3 YhvBv9EBJeL3xbDILXLu2yN08K8sbIy9H3qEepQXyq8dq/ACPAChhhGOVLS3XtPNbT/DCL syTMFJ/kw4gXhXTaySi374GbRC+qXEwF2tS7DeAIoJbnc6GBm9hJI5+k6c9PdtVllYdvIz C9hnQEe/Y3ETWUGhK8KLJ279Jo2lxJdagr7LV4gGs72ma5h3zAxr1mGSB3XoJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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