Re: tr A-Z a-z in locales other than C

Atom Smasher <[email protected]> Wed, 8 Jun 2011 09:56:39 +1200 (NZST)
Newsgroups gmane.os.freebsd.devel.internationalization,gmane.os.freebsd.devel.hackers
Message-ID <1106080945020.2239@smasher>
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

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-i18n
To unsubscribe, send any mail to "[email protected]"