i have used Collator to sort an array of objects. But I found out that it treats accented letters like normal ones:
Aktivierung
Änderung
Auszahlung
Bar
instead i would like to have this
Aktivierung
Auszahlung
Änderung
Bar
the accented letter should be placed right after the normal ones. That is also for o/ö and u/ü.
Collator collator = Collator.getInstance(Locale.GERMAN);
...
private void sortDocumentiByCategoria(final Collator collator, List<ListDocumenti> listDocumenti) {
Collections.sort(listDocumenti, new Comparator<ListDocumenti>(){
@Override
public int compare(ListDocumenti arg0, ListDocumenti arg1) {
return collator.compare(arg0.getDescrizione(), arg1.getDescrizione());
}
});
}