The way PB sorts the arrays isn't very good.
It uses ASCII instead of the natural order, which means that all words with accents are moved to the end of the list

There should be a special flag for the sorting command: #NATURAL or #LATIN
There is no single natural order. Characters can have different order depending on the language that is used. To implement this you would need the specify what language you are using.marcoagpinto wrote:There should be a special flag for the sorting command: #NATURAL or #LATIN
Yes! This is right!wilbert wrote:There is no single natural order. Characters can have different order depending on the language that is used. To implement this you would need the specify what language you are using.
Not the order of characters according to the unicode value!acreis wrote:Does not unicode solve this issue?
The Unicode collation algorithm (UCA) is an algorithm defined in Unicode Technical Report #10, which defines a customizable method to compare two strings. These comparisons can then be used to collate or sort text in any writing system and language that can be represented with Unicode.
Unicode Technical Report #10 also specifies the Default Unicode Collation Element Table (DUCET). This datafile specifies the default collation ordering. The DUCET is customizable for different languages. Some such customisations can be found in Common Locale Data Repository (CLDR).
Andre, could you provide a code snippet for me to use?Andre wrote:As a workaround I'm currently using another field in the structured list or array, which should be sorted.
In this extra structure element I copy the field contents to sort (e.g. names), but convert "special chars" before.
Or if I made it by hand, then mostly the first 4-5 chars should be enough for sorting...
But anyway I native support would be good!