in reply to Using system sort order
I had these bookmarked ages ago, but didn't look at them until today:#! perl use strict; use warnings; use utf8; use Unicode::Collate; binmode STDOUT => ':utf8'; my @words = ( "Maria Lenore", "Mária Helena", "María Dolores" ); my $col = Unicode::Collate->new(level => 1); my @sorted = $col->sort(@words); if ( "@sorted" eq "María Dolores Mária Helena Maria Lenore" ) { print("Sorted OK\n"); } elsif ( "@sorted" eq "Maria Lenore María Dolores Mária Helena" ) { print("Sorted C (ASCII)\n"); } else { print("Sort failed: @sorted\n"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using system sort order
by sciurius (Beadle) on Aug 11, 2025 at 14:31 UTC |