tr(1) buggy with de_DE.ISO8859-1(5) locale?

Dan Nelson dnelson at allantgroup.com
Fri Feb 3 13:13:29 PST 2006


In the last episode (Feb 03), Martin said:
> Dan Nelson wrote:
> >See the "tr" manpage, especially the EXAMPLES and COMPATIBILITY
> >sections.
> 
> From tr(1) COMPATIBILITY:
> 
> "Since tr now obeys the locale's collation order, this idiom may not
> produce correct results when there is not a 1:1 mapping between lower
> and upper case"
> 
> Does this mean that because there is no 1:1 mapping of
> lower/uppercase "ß", I will never be able to use ranges like "tr s-w
> S-W"?

tr uses the collation sequence when expanding ranges, so the real
problem is that the lowercase range "s-w" expands to "sßtuúùûüvw", and
the uppercase range "S-W" expands to "STUÚÙÛÜVW", which is a smaller
set.

An alternative would be to use "tr stuvw STUVW" or "tr stuúùûüvw
STUÚÙÛÜVW".

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-stable mailing list