[ standards@ Cc:ed ] On Mon, Aug 04, 2003 at 06:03:32PM +0400, Andrey Chernov wrote: > On Mon, Aug 04, 2003 at 17:57:13 +0400, Andrey Chernov wrote: > > > > There is > > > > > > tr '[a-z]' '[A-Z]' > > > > > > which can be different for different locales since use collate now as > > > required by POSIX. Please tell which exact non-C locale you use and what > > > happens? I miss start of this discussion. > > > > Well, I found error in the archives, so the question remains, what locale > > you use? > > For example, this result is right and not the bug (but wrong tr usage): > > env LANG=de_DE.ISO8859-1 tr '[a-z]' '[A-Z]' > vi_zero > WI_]ERO > Clearly this is a useless construct then.
I can read this in the POSIX.1-2003 spec when it comes to tr(1): : c-c In the POSIX locale, this construct shall : represent the range of collating elements between : the range endpoints (as long as neither endpoint : is an octal sequence of the form \octal), : inclusive, as defined by the collation sequence. : The characters or collating elements in the : range shall be placed in the array in ascending : collation sequence. If the second endpoint : precedes the starting endpoint in the collation : sequence, it is unspecified whether the range : of collating elements is empty, or this construct : is treated as invalid. In locales other than ^^^^^^^^^^^^^^^^^^^^^ : the POSIX locale, this construct has unspecified ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : behavior. ^^^^^^^^ This is identical to a similar issue with awk(1), and the latest snapshot of the One True AWK reverts to NOT using strcoll(3) to handle character ranges in RE, because different locales and even the same locales on different operating systems (FreeBSD, Linux, and Solaris were compared) have different ideas about the collating order. On Linux, the German locale's collating sequence will be ``A a ... B b'', while on FreeBSD, it's ``A B ... a b''. So I'd rather prefer if we revert to the old behavior in tr(1). Cheers, -- Ruslan Ermilov Sysadmin and DBA, [EMAIL PROTECTED] Sunbay Software Ltd, [EMAIL PROTECTED] FreeBSD committer
pgp00000.pgp
Description: PGP signature