if you want to sort your text based on a local like in my case it was turkish, you can use Collator class.
for example, in turkish ç character is between c and d, but if you use regular search, or use java.util.String’s compare method, ç will come after z.
so what you can do is as follows:
Collator collator = Collator.getInstance(new Locale("tr"));
this should do the trick.