Old_Gray_Bear has asked for the wisdom of the Perl Monks concerning the following question:
The code I am debugging takes a list of words and sorts them "alphabetically". Most of the time it works as expected, but now we are starting to get a few French-Canadian words in the corpus and "A accent-egu"(I thinks that's right, I am not a Francophone) falls at the end of the 'normal' alphabet (following Z), rather than sorting between 'A' and 'B' where I am told it should.$x = "\x{9e}"; # A-acute accent { use local; ($x =~ /a..zA..Z/) ? print "true\n" : print "not true\n"; }
I initially looked at the code and said "/self, it's a locale issue" and started reading the Doc on the 'locale' pragma. Three cups of coffee later, I still do understand why I'm not getting the 'correct' sort. I am obviously missing something basic here, but what?
----
I Go Back to Sleep, Now.
OGB
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Does 'use locale' Change What Is Considered To Be 'alphabetical order'?
by ikegami (Patriarch) on Aug 08, 2010 at 00:30 UTC | |
by Old_Gray_Bear (Bishop) on Aug 08, 2010 at 00:50 UTC | |
by ikegami (Patriarch) on Aug 08, 2010 at 01:02 UTC | |
|
Re: Does 'use locale' Change What Is Considered To Be 'alphabetical order'?
by jethro (Monsignor) on Aug 08, 2010 at 00:12 UTC | |
|
Re: Does 'use locale' Change What Is Considered To Be 'alphabetical order'?
by FunkyMonk (Bishop) on Aug 08, 2010 at 00:19 UTC |