How to use Query.order () for string properties containing non-English characters?

How to use Query.order () for string properties containing non-English characters so that objects that are selected in the correct order?

Query.order weirdly puts any non-English characters at the end of the list, for example:

Dolnośląskie Kujawsko-Pomorskie Lubelskie Lubuskie Mazowieckie Małopolskie <- incorrect order Opolskie Podkarpackie Podlaskie Pomorskie Warmińsko-Mazurskie Wielkopolskie Zachodniopomorskie Łódzkie <- incorrect order Śląskie <- incorrect order Świętokrzyskie <- incorrect order 

If the correct set for this shoul set is:

 Dolnośląskie Kujawsko-Pomorskie Łódzkie Lubelskie Lubuskie Małopolskie Mazowieckie Opolskie Podkarpackie Podlaskie Pomorskie Śląskie Świętokrzyskie Warmińsko-Mazurskie Wielkopolskie Zachodniopomorskie 

Is there any way? Besides putting another property with English normalized string values ​​just for ordering?

+4
source share
1 answer

Normalizing strings in a separate property is the only solution you want; they are sorted by unicode code points, and letters that are part of ASCII have much lower values ​​than non-ASCII characters.

+5
source

All Articles