News for hackers. Stuff that matters.
Re:2000x performance win by dododo on Saturday December 10, 2011 @09:28AM (#3337617)
here's another "fun" grep locale oddity:

   $ echo HI | LANG=en_US.utf8 grep '^[a-z]'
   HI
   $ echo HI | LANG=C grep '^[a-z]'
   $
apparently en_{GB,US}.utf8 orders a-z like aAbBcC..zZ.

   $ echo ZI | LANG=en_US.utf8 grep '^[a-z]'
   $
Re:2000x performance win by iso8859-1 on Saturday December 10, 2011 @09:47AM (#3337647)
This is what I get:

    $ echo HI | LANG=C grep '^[a-z]'
    $ echo HI | LANG=en_US.utf8 grep '^[a-z]'
    $ 
How come?
Re:2000x performance win by p9idf on Saturday December 10, 2011 @09:56AM (#3337660)
I was able to reproduce the bug. It could be a version thing.

  ; grep --version
  GNU grep 2.6.3
  ; echo A | LANG=en_US.utf8 grep '[a-z]'
  A
Re:2000x performance win by Ives on Saturday December 10, 2011 @04:12PM (#3338515)
No, I have the same version but not a similar result. I also have the en_US.utf8 locale installed.
Re:2000x performance win by ot on Saturday December 10, 2011 @10:01AM (#3337665)
I had the same problem with sort:

  $ sort <<EOF
  > Aa
  > aa
  > Ab
  > ab
  > EOF
  aa
  Aa
  ab
  Ab
I was going crazy because I was getting different results in OSX and Ubuntu. Setting the LANG to POSIX fixed it.
Re:2000x performance win by Macha on Saturday December 10, 2011 @02:42PM (#3338282)

    $ sort --version
    sort (GNU coreutils) 8.14
For what it's worth, this gets me the same results under LANG=C and LANG=en_US.utf8