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

From: Baptiste Daroussin <bapt_at_freebsd.org>
Date: Wed, 25 Nov 2015 01:27:01 +0100
On Wed, Nov 25, 2015 at 01:15:13AM +0100, Baptiste Daroussin wrote:
> 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

Actually I can make the fallback on the C locale in case of failure. Would that
work for you?

Best regards,
Bapt

Received on Tue Nov 24 2015 - 23:27:06 UTC

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