Sort Rules: Updated name comparison to not ignore non-ascii chars

Related to #5550 and #5542
This commit is contained in:
Dan Brown 2025-04-02 15:17:17 +01:00
parent abe7467ae5
commit 1ba0d26fdd
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 4 additions and 2 deletions

View File

@ -14,12 +14,12 @@ class SortSetOperationComparisons
{
public static function nameAsc(Entity $a, Entity $b): int
{
return strtolower(ASCII::to_transliterate($a->name)) <=> strtolower(ASCII::to_transliterate($b->name));
return strtolower(ASCII::to_transliterate($a->name, null)) <=> strtolower(ASCII::to_transliterate($b->name, null));
}
public static function nameDesc(Entity $a, Entity $b): int
{
return strtolower(ASCII::to_transliterate($b->name)) <=> strtolower(ASCII::to_transliterate($a->name));
return strtolower(ASCII::to_transliterate($b->name, null)) <=> strtolower(ASCII::to_transliterate($a->name, null));
}
public static function nameNumericAsc(Entity $a, Entity $b): int

View File

@ -200,6 +200,8 @@ class SortRuleTest extends TestCase
"bread",
"Éclaire",
"egg",
"É😀ire",
"É🫠ire",
"Milk",
"pizza",
"Tomato",