Re: /bin/ls formatting broken for non-C(?) locales

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Sat, 21 Nov 2015 02:57:51 +0100
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

Received on Sat Nov 21 2015 - 00:57:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:01 UTC