Gentoo Archives: gentoo-portage-dev

From: felix@×××××××.com
To: gentoo-portage-dev@g.o
Subject: [gentoo-portage-dev] Re: Perl, sort, and locale -- NEVER MIND
Date: Thu, 04 May 2006 20:25:18
Message-Id: 20060504202344.GA8747@crowfix.com
In Reply to: [gentoo-portage-dev] Perl, sort, and locale by felix@crowfix.com
1 On Wed, May 03, 2006 at 05:12:09PM -0700, felix@×××××××.com wrote:
2
3 > I have discovered an inconsistency in how perl and sort handle locale.
4 > Here are two commands you can run in a shell ...
5 >
6 > (echo '/'; echo '?') | sort
7 >
8 > (echo '/'; echo '?') | perl -e '@x = <>; print $_ foreach sort @x'
9 >
10 > With LANG=en_US.UTF-8, sort says ? comes before /, perl says the
11 > opposite. Setting LC_COLLATE=C switches the sort behavior.
12
13 I have now found that if you add "use locales" to the perl code, it
14 also sorts utf difefrently.
15
16 --
17 ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
18 Felix Finch: scarecrow repairman & rocket surgeon / felix@×××××××.com
19 GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
20 I've found a solution to Fermat's Last Theorem but I see I've run out of room o
21 --
22 gentoo-portage-dev@g.o mailing list

Replies