Click to See Complete Forum and Search --> : Sorting language specific characters


kurent
08-29-2008, 03:24 AM
This is an international forum and my language as others have characters not present in others. Characters like č š ž ć đ (hope you see them correctly).

This causes a problem when sorting since these characters get placed at the end. You would think you need to set the language or locale to your liking, but looking at the character table for my language (latin-2), these characters are also placed below all others.

How can I make my sorting algorithms work right? Maybe if I replace these troublesome characters with something else? For example "č" would become "czzz"? But what if the user wants czzz because it's an acronym for something?

Help! :confused:

Khalid Ali
08-29-2008, 07:36 AM
did u try to use your own Comparator for sorting?
if not then here is a quick read (with example) (http://www.leepoint.net/notes-java/data/collections/comparators.html)

kurent
09-03-2008, 05:35 AM
I looked at these operators and ended up writting a sorting algorithm from scratch which takes a definition of the alphabet as you want it.