From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 7 23:00:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8613F106566C; Tue, 7 Jun 2011 23:00:44 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 287E78FC0C; Tue, 7 Jun 2011 23:00:44 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 27A8C1DD97B; Wed, 8 Jun 2011 01:00:43 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 100431753C; Wed, 8 Jun 2011 01:00:43 +0200 (CEST) Date: Wed, 8 Jun 2011 01:00:43 +0200 From: Jilles Tjoelker To: Atom Smasher Message-ID: <20110607230042.GB16994@stack.nl> References: <20110606224105.GA92410@stack.nl> <1106080945020.2239@smasher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106080945020.2239@smasher> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, freebsd-i18n@freebsd.org Subject: Re: tr A-Z a-z in locales other than C X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2011 23:00:44 -0000 On Wed, Jun 08, 2011 at 09:56:39AM +1200, Atom Smasher wrote: > the man page makes it clear... > Translate the contents of file1 to upper-case. > tr "[:lower:]" "[:upper:]" < file1 > (This should be preferred over the traditional UNIX idiom of ``tr a-z > A-Z'', since it works correctly in all locales.) > for any other uses, either build the port with locale specified as "C" as > mentioned, or patch the port so: > tr '[a-z]' '[A-Z]' > becomes: > env LC_ALL=C tr '[a-z]' '[A-Z]' > the only change that would be appropriate to the tr utility would be a > command-line option to select a locale... something like: > tr -l C '[a-z]' '[A-Z]' > i don't think anyone would object to that, but it would still require > patching some ports under some locales... That new option would provide zero benefit. If things are going to be patched anyway then patch them to be standards compliant. > maybe another option would be modifying tr to recognize other [new] > environment variables... TR_LANG, TR_LC_ALL, TR_LC_CTYPE and > TR_LC_COLLATE. done that way, things could be set in /etc/make.conf (or > sys.mk), not need any patching, and not interfere with other uses of > locale. That would be rather ugly. If tr a-z A-Z is supposed to be deceiving in some locales, then let it remain so unconditionally. -- Jilles Tjoelker