Date: Fri, 20 Nov 2015 11:42:53 +0100 From: Baptiste Daroussin <bapt@FreeBSD.org> To: "Sergey V. Dyatko" <sergey.dyatko@gmail.com> Cc: freebsd-current@freebsd.org Subject: Re: /bin/ls formatting broken for non-C(?) locales Message-ID: <20151120104253.GA21071@ivaldir.etoilebsd.net> In-Reply-To: <20151120110556.6e20a71f@laptop.minsk.domain> References: <20151120110556.6e20a71f@laptop.minsk.domain>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Fri, Nov 20, 2015 at 11:05:56AM +0300, Sergey V. Dyatko wrote: > Hi, > > subj. http://i.imgur.com/F9QO29l.png > it is on head@r290573: > WTR: > env LC_ALL=uk_UA.UTF-8 ls -la /usr/ports/databases/ or env LC_ALL=ru_RU.UTF-8 > ls -la /usr/ports/databases/ > > env LC_ALL=C ls -la /usr/ports/databases/ works fine > also on old stable/10 (r286868) as I can see 'month' field length 3 symbols > Thanks for reporting, I can reproduce the issue with some other locales. The thing is there seems to be no standard for abbreviated length. Formerly we had a 3 character lenght for abbreviated month. We now use CLDR which seems to follow the abbreviated rules from IBM: "Each string must be of equal length and contain 5 characters or less" There are 2 possible fixes: either always pad those in the locale definition which seems wrong or modify ls so that it by itself pads properly. Neither posix nor ISO-14652 defines the length of the abbreviated form padding in the locales themself would be wrong so I do propose to pad in the ls command. And padding with 5 characters. Best regards, Bapt [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZO+SwACgkQ8kTtMUmk6EyDdACffb0iUN7MzdUYaPLp/fnV7wt6 1RgAoLMOy2DucpqAOZ0T9gR4s4OX8zKf =XeX9 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151120104253.GA21071>
