fix #1427, properly handle diacritics at sorting

This commit is contained in:
tibbi 2022-02-13 17:57:30 +01:00
parent f3e76cfb50
commit 581dd43bd6
2 changed files with 4 additions and 4 deletions

View file

@ -139,9 +139,9 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
}
if (sorting and SORT_USE_NUMERIC_VALUE != 0) {
AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase())
AlphanumericComparator().compare(o1.sortValue.normalizeString().toLowerCase(), o2.sortValue.normalizeString().toLowerCase())
} else {
o1.sortValue.toLowerCase().compareTo(o2.sortValue.toLowerCase())
o1.sortValue.normalizeString().toLowerCase().compareTo(o2.sortValue.normalizeString().toLowerCase())
}
}
sorting and SORT_BY_PATH != 0 -> {

View file

@ -761,9 +761,9 @@ class MediaFetcher(val context: Context) {
var result = when {
sorting and SORT_BY_NAME != 0 -> {
if (sorting and SORT_USE_NUMERIC_VALUE != 0) {
AlphanumericComparator().compare(o1.name.toLowerCase(), o2.name.toLowerCase())
AlphanumericComparator().compare(o1.name.normalizeString().toLowerCase(), o2.name.normalizeString().toLowerCase())
} else {
o1.name.toLowerCase().compareTo(o2.name.toLowerCase())
o1.name.normalizeString().toLowerCase().compareTo(o2.name.normalizeString().toLowerCase())
}
}
sorting and SORT_BY_PATH != 0 -> {