From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 7 22:23:24 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 17135106566C for ; Tue, 7 Jun 2011 22:23:24 +0000 (UTC) (envelope-from atom@smasher.org) Received: from atom.smasher.org (atom.smasher.org [69.55.237.145]) by mx1.freebsd.org (Postfix) with SMTP id D46178FC18 for ; Tue, 7 Jun 2011 22:23:23 +0000 (UTC) Received: (qmail 98971 invoked by uid 1000); 7 Jun 2011 21:56:42 -0000 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Date: Wed, 8 Jun 2011 09:56:39 +1200 (NZST) From: Atom Smasher In-Reply-To: <20110606224105.GA92410@stack.nl> Message-ID: <1106080945020.2239@smasher> MIME-Version: 1.0 OpenPGP: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt References: <20110606224105.GA92410@stack.nl> To: freebsd-hackers@freebsd.org X-POM: The Moon is Waxing Crescent (37% of Full) X-Hashcash: 1:20:1106072156:freebsd-hackers@freebsd.org::oAFr083FldiGMCkw:000000 0000000000000000000000000XyB X-Hashcash: 1:20:1106072156:freebsd-i18n@freebsd.org::q2DIAFaqBYjAk1RV:000000000 0000000000000000000000004Jzl Cc: 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 22:23:24 -0000 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... 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. -- ...atom ________________________ http://atom.smasher.org/ 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- "We in the West must bear in mind that the poor countries are poor primarily because we have exploited them through political or economic colonialism." -- Martin Luther King, Jr