Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorting strings in Japanese

I am in the process of localizing my android application to Japanese. I have the localized strings. But for example, when displaying a list, I need the strings to be displayed in an alphabetical order.

Is there a way I can sort Japanese strings alphabetically (because all I see is symbols :P).

like image 291
Mayur More Avatar asked Oct 21 '25 13:10

Mayur More


1 Answers

Have you tried using collator:

Collator collator = Collator.getInstance(Locale.JAPANESE);
Collections.sort(list, collator);

?

like image 200
agad Avatar answered Oct 24 '25 02:10

agad