Date: Wed, 25 Nov 2015 01:15:13 +0100 From: Baptiste Daroussin <bapt@freebsd.org> To: Andrey Chernov <ache@freebsd.org> Cc: Ed Schouten <ed@nuxi.nl>, Jilles Tjoelker <jilles@stack.nl>, "Sergey V. Dyatko" <sergey.dyatko@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: /bin/ls formatting broken for non-C(?) locales Message-ID: <20151125001513.GC70014@ivaldir.etoilebsd.net> In-Reply-To: <5650DACA.2090501@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> <CABh_MK=cz-zB7krcnKjhqfW9VnwjSmuaZ9%2BAETQiLy3AsHq_vw@mail.gmail.com> <5650DACA.2090501@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Sat, Nov 21, 2015 at 11:57:46PM +0300, Andrey Chernov wrote: > On 21.11.2015 15:18, Ed Schouten wrote: > > Hi Baptiste, > > > > I suppose you should use the wcswidth() function somewhere to compute > > the visible width of the month name. Some characters may be > > double-width, others may have no effective width at all. > > > > I agree. Checking error return of wide chars functions with some > fallback will be good too. I have updated the code https://reviews.freebsd.org/D4239 Tested by modifying some locales to add double width and zero width unicode in the locales Also added the error checking for the return of wide chars functions. For now I haven't added fallback, suggestions welcome if needed. Best regards, Bapt [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZU/ZEACgkQ8kTtMUmk6ExUtACgs8xFg+1g0rt8/e+NF30AV2Yf 8bcAn3RHXyepWHrG71dmNkjVaxWi+s8J =Xci3 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151125001513.GC70014>
