berkes/tagadelic — Issue #29: Wrong sorting for non-ASCII tags
Author: RedRat
Created: 2012-02-13 15:03:34+00:00
State: open

There is [a bug in the PHP strnatcasecmp function](https://bugs.php.net/bug.php?id=61023), which prevents it to sort non-ASCII letters correctly. Due to this bug all non-ASCII tags in tagadelic sorted wrongly: all uppercase tags first and then all lowercase.

There is a workaround for this problem: just replace

`return strnatcasecmp($a->name, $b->name);`

to

`return strnatcmp(mb_strtolower($a->name, 'UTF-8'), mb_strtolower($b->name, 'UTF-8');`

It was tested on cyrillic tags and works fine for me.