utf8-all icon indicating copy to clipboard operation
utf8-all copied to clipboard

Rewrite string comparisons with Unicode::Collate

Open doherty opened this issue 13 years ago • 0 comments

From http://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default/#6163129:

String comparisons in Perl using eq, ne, lc, cmp, sort, &c&cc are always wrong. So instead of @a = sort @b, you need @a = Unicode::Collate->new->sort(@b). Might as well add that to your export PERL5OPTS=-MUnicode::Collate. You can cache the key for binary comparisons.

doherty avatar May 30 '11 02:05 doherty