Sorting and splitting works incorrectly with non-Latin letters or Latin letters with diactrics
Description
System language is English, VLC locale is "Device default", "Show headers" (splits list by headers depending on the sort type) is on.
I am browsing the Audio library, looking at "Artists" tab.
Sorting and grouping works correctly only in case of Latin (A
...Z
) letters. However, if artist (or album) name is written using non-Latin (e. g. Cyrillic, А
...Я
) letters or Latin letters with diactrics (e. g. Í
), it works incorrectly.
Let's consider 3 artists: "a-ha", "Índios Tabajaras, Los" (note the first letter with diactric), and "а-ха" (these are Cyrillic letters, not Latin).
Expected behavior
I would expect:
- "a-ha" artist is listed in the group
A
(Latin). - "Índios Tabajaras, Los" artist is listen in the group
I
(Latin) (i. e. sorting ignores diactrics). - "а-ха" artist is listed in group
А
(Cyrillic) (i. e. sorting ignores case).
Actual behavior
- "a-ha" artist is listed in the group
A
— OK. This proves that VLC ignores case when sorting the list of artists and splitting it to parts. - "Índios Tabajaras, Los" artist is listen in the group
Í
, which follows the groupZ
. - "а-ха" artist is listed in the second group
А
, which follows the groupЯ
. Note that group headerА
is in upper case, but there are two groupsА
: the first, valid groupА
is the first Cyrillic group (sinceА
is the first Russian character) includes artists whose names start with upper caseА
letter; the second, invalid groupА
(at the end of the Cyrillic groups) includes artists whose names start with lower caseа
Cyrillic letter.
Steps to reproduce
- Tag some mp3 files with Album Artist "a-ha", "Índios Tabajaras, Los", and "а-ха" and put them into the music library on the phone.
- Start VLC, let it refresh the library.
- See the list of artists, look at artists "a-ha", "Índios Tabajaras, Los", and "а-ха".
Screenshots
Artist "a-ha" is listed in the group A
, as expected:
Artist "Índios Tabajaras, Los" is listed in the group Í
which is is located after all other Latin groups (the group А
is Cyrillic group):
Artist "а-ха" is listed in the second А
at the end of the list:
Context
App version
VLC 3.4.4.
Android version
LineageOS 19.1 (Android 12).
Device model
Asus Zenfone Max Pro M1 (X00TD).
App mode
Smartphone
P. S.
This issue is related to #1905. It seems VLC does not use locales (in particular, collation) correctly.