Re: Is Sort:Naturally a Little Off?

[email protected] (Shawn H Corey) Sat, 25 Sep 2021 03:37:41 -0400
Newsgroups perl.module-authors
Message-ID <[email protected]>
--------------C1733AD535BB182D82C50DE6
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Setting LC_ALL=C gives the Unicode sequence for Perl's sort but 
Sort::Naturally still does not seem correct:

LC_ALL=C ./sort-test.pl
unsorted              : 4 A X i 1 x 10 a B ä y z į C Ä b c Į Y Z än and 
ÄND And Any ant Äm Äs

no locale,  perl      : 1 10 4 A And Any B C X Y Z a and ant b c i x y z 
Ä ÄND Äm Äs ä än Į į
no locale,  naturally : 1 4 10 Ä ä A a And and ant Any B b C c i Äm än 
ÄND Äs X x Y y Z z Į į

use locale, perl      : 1 10 4 A And Any B C X Y Z a and ant b c i x y z 
Ä ÄND Äm Äs ä än Į į
use locale, naturally : 1 4 10 Ä ä A a And and ant Any B b C c i Äm än 
ÄND Äs X x Y y Z z Į į

use locale, perl num  : 1 4 10 A And Any B C X Y Z a and ant b c i x y z 
Ä ÄND Äm Äs ä än Į į


--------------C1733AD535BB182D82C50DE6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Setting LC_ALL=C gives the Unicode sequence for Perl's sort but
      Sort::Naturally still does not seem correct:</p>
    <p><font face="monospace">LC_ALL=C ./sort-test.pl <br>
        unsorted              : 4 A X i 1 x 10 a B ä y z į C Ä b c Į Y Z
        än and ÄND And Any ant Äm Äs<br>
        <br>
        no locale,  perl      : 1 10 4 A And Any B C X Y Z a and ant b c
        i x y z Ä ÄND Äm Äs ä än Į į<br>
        no locale,  naturally : 1 4 10 Ä ä A a And and ant Any B b C c i
        Äm än ÄND Äs X x Y y Z z Į į<br>
        <br>
        use locale, perl      : 1 10 4 A And Any B C X Y Z a and ant b c
        i x y z Ä ÄND Äm Äs ä än Į į<br>
        use locale, naturally : 1 4 10 Ä ä A a And and ant Any B b C c i
        Äm än ÄND Äs X x Y y Z z Į į<br>
        <br>
        use locale, perl num  : 1 4 10 A And Any B C X Y Z a and ant b c
        i x y z Ä ÄND Äm Äs ä än Į į<br>
        <br>
      </font></p>
  </body>
</html>

--------------C1733AD535BB182D82C50DE6--