bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: range expressions in regexps in non-C locale


From: Pádraig Brady
Subject: Re: range expressions in regexps in non-C locale
Date: Sun, 19 Feb 2012 17:36:44 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 02/19/2012 02:08 PM, Bruno Haible wrote:
> Hi,
> 
> In basic regular expressions, range expressions are not safe to use outside
> the C locale; the results vary between implementations and locales.
> 
> - For 'grep' this was explained in
>   https://lists.gnu.org/archive/html/bug-grep/2011-06/msg00031.html
>   https://lists.gnu.org/archive/html/bug-grep/2012-01/msg00088.html
>   http://savannah.gnu.org/bugs/?32337
> 
> - For 'tr' I'm seeing this on Solaris 11 2011-11 in de_DE.UTF-8 locale:
> $ echo abcdefghijklmnopqrstuvwxyz | /usr/bin/tr 'a-z' 'A-Z'
> AbcdefghijklmnopqrstuvwxyZ
> $ echo abcdefghijklmnopqrstuvwxyz | /usr/bin/tr '[a-z]' '[A-Z]'
> ABCDEFGHIJKLMNOPQRSTUVWXYZ

That was documented in autoconf recently:
http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=efa12744

> $ echo abcdefghijklmnopqrstuvwxyz | /usr/xpg4/bin/tr 'a-z' 'A-Z'
> ABⓒ𝚍ⓔFGH𝙞JK𝚕ⓜNOPQⓡSTUⓥWⓧYZ
> $ echo abcdefghijklmnopqrstuvwxyz | /usr/xpg4/bin/tr '[a-z]' '[A-Z]'
> ABⓒ𝚍ⓔFGH𝙞JK𝚕ⓜNOPQⓡSTUⓥWⓧYZ
> $ echo abcdefghijklmnopqrstuvwxyz | /usr/xpg6/bin/tr 'a-z' 'A-Z'
> ABⓒ𝚍ⓔFGH𝙞JK𝚕ⓜNOPQⓡSTUⓥWⓧYZ
> $ echo abcdefghijklmnopqrstuvwxyz | /usr/xpg6/bin/tr '[a-z]' '[A-Z]'
> ABⓒ𝚍ⓔFGH𝙞JK𝚕ⓜNOPQⓡSTUⓥWⓧYZ

LOL

patch looks good BTW

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]