Date: Sat, 21 Nov 2015 02:57:51 +0100 From: Baptiste Daroussin <bapt@FreeBSD.org> To: Andrey Chernov <ache@freebsd.org> Cc: Jilles Tjoelker <jilles@stack.nl>, "Sergey V. Dyatko" <sergey.dyatko@gmail.com>, freebsd-current@freebsd.org Subject: Re: /bin/ls formatting broken for non-C(?) locales Message-ID: <20151121015750.GG21071@ivaldir.etoilebsd.net> In-Reply-To: <564FBEA9.7070100@freebsd.org> References: <20151120110556.6e20a71f@laptop.minsk.domain> <20151120104253.GA21071@ivaldir.etoilebsd.net> <20151120110212.GB21071@ivaldir.etoilebsd.net> <20151120122352.GA5751@stack.nl> <20151121003541.GF21071@ivaldir.etoilebsd.net> <564FBEA9.7070100@freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Sat, Nov 21, 2015 at 03:45:29AM +0300, Andrey Chernov wrote: > On 21.11.2015 3:35, Baptiste Daroussin wrote: > > > Here is what I do propose (sorry for the ugly pad_to_col name, if one has better > > please share :D > > > > https://reviews.freebsd.org/D4239 > > The whole function is ugly, not only its name. Please no hardcoded > constants assuming some internal encoding knowledge, they are wrong for > non-UTF-8 encodings in any case, use wide chars instead. > > BTW, the same 3 chars restriction is in tar, cpio, pax, lots of ftp > clients, i.e. where 'ls' emulated. > Updated to use wide char functions. tested with ru_RU.UTF-8 and ru_RU.KOI8-R, fr_FR.UTF-8, ja_JP.eucJP and some chinese locales. Concerning tar and cpio, I can probably push the same thing into bsdtar (which will fix the same issue they also have on linux), ftp is safe, pax is not and could probably be fixed as well. FYI on linux only ls has been fixed. gnutar uses a different format for its output. Bapt [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZPz54ACgkQ8kTtMUmk6EwMTQCeNqfmdFtXf7+cB7Kx7XPxO6ZZ nNoAoJFJL5NLcwkQoXkvo8/lTZaRCdOH =u3F3 -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151121015750.GG21071>
