Cyrillic natural order sorting

Created on 15 May 2010, over 14 years ago
Updated 13 September 2024, 4 months ago

strnatcasecmp have bug with cyrillic characters and UTF-8 encoding. This module use next constraction for sort by title:

 function _cctags_sort_by_title($a, $b) {
  return strnatcasecmp($a->name, $b->name);
} 

Working constration is something like:

 function _cctags_sort_by_title($a, $b) {
  $namea = iconv('UTF-8', 'cp1251',$a->name);
  $nameb = iconv('UTF-8', 'cp1251',$b->name);
  $namea = cyr_strtolower($namea);
  $nameb = cyr_strtolower($nameb);
  return strnatcasecmp($namea, $nameb);
} 
πŸ› Bug report
Status

Closed: outdated

Version

1.5

Component

Code

Created by

πŸ‡·πŸ‡ΊRussia areafix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024