locales.

[prev] [thread] [next] [lurker] [Date index for 2006/12/22]

From: Guy Thornley
Subject: locales.
Date: 04:43 on 22 Dec 2006
Well, this is new to me. Perhaps it new to you, too. Or maybe not.

Follow closely.

    $ ls
    Alan Parsons Project - 1976 - Tales of Mystery and Imagination/
    cd1/
    cd2/
    Yahel - Waves of sound/
    Younger Brother - A Flock of Bleeps/
    $ mv [A-Z]* cd2/
    mv: cannot move `cd2' to a subdirectory of itself, `cd2/cd2'
    $ ls
    cd2/

Uhm? Since when were shell globs case *in*sensitive??

Yes, I know about nocaseglob:

    $ shopt
    nocaseglob      off

which, according to the manpage, should make globs case sensitive.

    $ echo $LANG
    en_NZ.UTF-8

It gets worse:

    $ touch a b C D
    $ ls
    a  b  C  cd2/  D

    $ echo [A-Z]*
    b C cd2 D

Geezuz, where did little-'a' go?? A colleague pointed out that little-'a' is
sorting before big-'A' now.

This is just wrong, on every single level I think of, this is WRONG.

Easy to demonstrate it is locale:

    $ bash -c 'echo [A-Z]*'
    b C cd2 D
    $ unset LANG; bash -c 'echo [A-Z]*'
    C D

Why should I use locales ever again? This behaviour is not just hateful; it
is outright terrifying.

.Guy

Generated at 20:02 on 28 Dec 2006 by mariachi 0.52