From owner-freebsd-current@freebsd.org Wed Nov 25 00:27:06 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10637A36B5A for ; Wed, 25 Nov 2015 00:27:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CB819B0; Wed, 25 Nov 2015 00:27:05 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmvv187 with SMTP id v187so234224332wmv.1; Tue, 24 Nov 2015 16:27:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=6QVT/SlorvCZX4F2ffxcvkLEjDwasGTOvMsqiHucK8Y=; b=w/q9ip541R6mVv/z9aNrLmEjmx4ZRo21qKYp77pzUMrUMifb82aStigMdehfHMX30h jrYE8pK88HzNzol/FA2Luk82Blf4fFE5vFX2MHUy9CaNr5WvEBm9MN5z8M+4/kFG60Ek SBQIyJIQiDi9ag9oQZDhDrciUk2kCh12ExdpqvBkk0DrbsH1lxKl+bCLcwcTz6lt/cLx HwfhygDdBvKLNQ0d1Og8ZNqOK+o1I6DNWnpXXXfa6cHgzuNblz8HjARlk8ZdP1Y8bArj YptUH5fSJhs9YtMa2iVjnZeBNAbCElVE9WJbVl3uMNhpmcY9yxxSGVlMz44AXR28Tlwk W0CA== X-Received: by 10.194.202.163 with SMTP id kj3mr37850168wjc.93.1448411223990; Tue, 24 Nov 2015 16:27:03 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id gl10sm20509010wjb.30.2015.11.24.16.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2015 16:27:03 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 25 Nov 2015 01:27:01 +0100 From: Baptiste Daroussin To: Andrey Chernov Cc: Ed Schouten , Jilles Tjoelker , "Sergey V. Dyatko" , FreeBSD Current Subject: Re: /bin/ls formatting broken for non-C(?) locales Message-ID: <20151125002701.GD70014@ivaldir.etoilebsd.net> 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> <5650DACA.2090501@freebsd.org> <20151125001513.GC70014@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0/kgSOzhNoDC5T3a" Content-Disposition: inline In-Reply-To: <20151125001513.GC70014@ivaldir.etoilebsd.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2015 00:27:06 -0000 --0/kgSOzhNoDC5T3a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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, > > >=20 > > > 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. > > >=20 > >=20 > > I agree. Checking error return of wide chars functions with some > > fallback will be good too. >=20 > I have updated the code https://reviews.freebsd.org/D4239 >=20 > Tested by modifying some locales to add double width and zero width unico= de in > the locales >=20 > Also added the error checking for the return of wide chars functions. For= now I > haven't added fallback, suggestions welcome if needed. >=20 > 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 --0/kgSOzhNoDC5T3a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZVAFUACgkQ8kTtMUmk6Ex6QgCeN81r9IqSIB9ZOZB9yBgHwDAc f7AAnRWHnV9GmauE9pHQ/8WoO40rsool =N6TB -----END PGP SIGNATURE----- --0/kgSOzhNoDC5T3a--