Re: sort -m and locale?



Folks, I ran this one to ground. Turns out it's a Suse 10.0 problem.
During one of the updates as someone changed some code to fix a security
problem they messed up the month code in sort. The program reads the
lines properly and then forces the month to all upper case befroe
comparing. So far everything is wonderful. Then the code reads the
months from the system using the locale information. Again everyting is
wonderful; sort of. The months from the system are in upper and lower
case so they must be converted to all uppper case before the comparison.
WHoever changed the code didn't handle that part so the comarison was
from an all uppercase (JAN) to a mixed case (Jan). That caused the
comparison to return bogus information and the sort was incorrect.

I actualy patched the code and now my sort works like everyone elses.

In the end I put up a red herring for everyone to follow with the locale
issue and most of us went right down that path. This had nothing to do
with locales other than a tired programmer was up working when he/she
shold have been located in bed getting some rest.
.



Relevant Pages

  • Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4
    ... mention locale. ... with this type of sort. ... I ended up doing a bubble-type sort on the key, and single inquiries ... use the ORDER BY statement, but, in the case of a key field, it may not be ...
    (microsoft.public.sqlserver.programming)
  • Re: why sort is soo slow on RH9?
    ... LANG variable will show you your locale settings. ... For a numeric sort it doesn't matter, ...
    (comp.os.linux.misc)
  • Locale in apache cgi
    ... I have been trying to sort a list of names in a perl cgi ... The default "C" locale doesn't sort non-English ... variable that's used when apache starts to "en_US", ...
    (comp.infosystems.www.servers.unix)
  • Re: sort -m and locale?
    ... I'm trying to get sort by month working. ... and my locale stuff is set like this: ... I'm aware there are many workarounds for this problem and I'm not really ...
    (comp.unix.shell)
  • Locale not working with Unicode strings in Perl 5.8?
    ... After an upgrade from Perl 5.6 to perl 5.8, strings with character semantics ... I sort a latin1-encoded string and a utf8-encoded string. ... semantics sorted just fine as long as I used 'locale'. ...
    (comp.lang.perl.misc)