Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-portage-dev
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-portage-dev@g.o
From: felix@...
Subject: Re: Perl, sort, and locale -- NEVER MIND -- SIGH
Date: Thu, 4 May 2006 15:07:40 -0700
On Thu, May 04, 2006 at 01:23:44PM -0700, felix@... wrote:
> On Wed, May 03, 2006 at 05:12:09PM -0700, felix@... wrote:
> 
> > I have discovered an inconsistency in how perl and sort handle locale.
> > Here are two commands you can run in a shell ...
> > 
> >     (echo '/'; echo '?') | sort
> > 
> >     (echo '/'; echo '?') | perl -e '@x = <>; print $_ foreach sort @x'
> > 
> > With LANG=en_US.UTF-8, sort says ? comes before /, perl says the
> > opposite.  Setting LC_COLLATE=C switches the sort behavior.
> 
> I have now found that if you add "use locales" to the perl code, it
> also sorts utf difefrently.

And I have now found that even with "use locale" ("locales" is a
typo), perl disagrees with sort and postgres for certain values of
"bin" and "/bin".

The moral of the story is to not rely on perl text ordering to match
at least sort and postgres, and probably almost every other external
command.

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@...
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
-- 
gentoo-portage-dev@g.o mailing list


References:
Perl, sort, and locale
-- felix
Re: Perl, sort, and locale -- NEVER MIND
-- felix
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Perl, sort, and locale -- NEVER MIND
Next by thread:
default postsync
Previous by date:
Re: default postsync
Next by date:
Re: default postsync


Updated Jun 17, 2009

Summary: Archive of the gentoo-portage-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.