SOURCES: pwdutils.login.defs - fix locale issue

Andrzej Krzysztofowicz ankry at green.mif.pg.gda.pl
Tue Nov 30 16:38:19 CET 2004


Radoslaw Zielinski wrote:
> So, as I understand, [a-z] may or may not contain a pink elephant, which
> makes it pretty useless.  What was the point...?

If it is defined...

> And this is just sick:
> 
>   $ echo x | LC_ALL=3Det_EE grep '[a-z]'
>   $ echo x | LC_ALL=3Det_EE grep '[a-x]'  # shouldn't be invalid?

It shouldn't. But it can be invalid.
pl_PL locale defines cyrillic and Greek alphabet collation.
But it does not define Laotian nor Chinese.

>   x
>   $ echo x | LC_ALL=3Det_EE grep '[a-y]'  # no, "x" is somewhere...
>   x
>   $ echo z | LC_ALL=3Det_EE grep '[a-y]'  # this isn't ASCII order for sure.
>   z
> 
> BTW, perl implements more logical behaviour:
> 
>   # LC_ALL is pl_PL.ISO-8859-2
>   $ echo =B1 | perl -Mlocale -nle 'print if /[a-z]/'
>   $ echo =B1 | perl -Mlocale -nle 'print if /[[:alpha:]]/'
>   =B1

If it is specified - fine. If it is not - then it is risky relying on it.
(I don't know perl regexp specification)

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry at mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Gdansk University of Technology




More information about the pld-devel-en mailing list