From owner-freebsd-current@freebsd.org Fri Nov 20 10:42:58 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 9F37DA33CBB for ; Fri, 20 Nov 2015 10:42:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 4BE641C40 for ; Fri, 20 Nov 2015 10:42:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wmdw130 with SMTP id w130so14365311wmd.0 for ; Fri, 20 Nov 2015 02:42:56 -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=lWOajhDfS2Ir+2tFljo+Srktev/SQCTUOyFdEzw/Y1E=; b=xVS/+wfciodwGXCYhfJUVjOdHASm7MxfzCCKYTksKyh8g4dfiOaa40M70ekBcEEn/S BN75izxOV8/y/qeEP6GYs1kokPCwi7tw1cAr/V7rYvXGZcfR4MyetGiFpKY5uj3yMt6j sV+7NGv5abcFtlRK81BCYi4bLIhDUs1u5Ls0wotyvzZJQhaj0/5sZf+6NWwWjwacoBQD c0ePN9SJh9klvhh4zDe/mUQmVYT3WZwIM7ZT6wjT28ZSA4e+Wk76u+wtPaMtGlOJWSwg WcjrkjYG5WPxENJJh9E7Auiz6neYPad1NTFamNP/hbkpKVOCXESfGsUzy4kDsrll4hVm IkQw== X-Received: by 10.28.176.70 with SMTP id z67mr1633970wme.5.1448016176386; Fri, 20 Nov 2015 02:42:56 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id b84sm2151819wmh.15.2015.11.20.02.42.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2015 02:42:55 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 20 Nov 2015 11:42:53 +0100 From: Baptiste Daroussin To: "Sergey V. Dyatko" Cc: freebsd-current@freebsd.org Subject: Re: /bin/ls formatting broken for non-C(?) locales Message-ID: <20151120104253.GA21071@ivaldir.etoilebsd.net> References: <20151120110556.6e20a71f@laptop.minsk.domain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20151120110556.6e20a71f@laptop.minsk.domain> 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: Fri, 20 Nov 2015 10:42:58 -0000 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 20, 2015 at 11:05:56AM +0300, Sergey V. Dyatko wrote: > Hi, >=20 > subj. http://i.imgur.com/F9QO29l.png > it is on head@r290573: > WTR: > env LC_ALL=3Duk_UA.UTF-8 ls -la /usr/ports/databases/ or env LC_ALL=3Dru_= RU.UTF-8 > ls -la /usr/ports/databases/ >=20 > env LC_ALL=3DC ls -la /usr/ports/databases/ works fine > also on old stable/10 (r286868) as I can see 'month' field length 3 symb= ols=20 >=20 Thanks for reporting, I can reproduce the issue with some other locales. The thing is there seems to be no standard for abbreviated length. Formerly we = had a 3 character lenght for abbreviated month. We now use CLDR which seems to follow the abbreviated rules from IBM: "Each string must be of equal length and contain 5 characters or less" There are 2 possible fixes: either always pad those in the locale definition which seems wrong or modify ls so that it by itself pads properly. Neither posix nor ISO-14652 defines the length of the abbreviated form padding in the locales themself would be wrong so I do propose to pad in th= e ls command. And padding with 5 characters. Best regards, Bapt --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlZO+SwACgkQ8kTtMUmk6EyDdACffb0iUN7MzdUYaPLp/fnV7wt6 1RgAoLMOy2DucpqAOZ0T9gR4s4OX8zKf =XeX9 -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY--