None of the above solutions depend on the locale, so I came up with this solution, it is inefficient, but it works very well.
public static String localeSpecificStringSort(String str, Locale locale) { String[] strArr = new String[str.length()]; for(int i=0;i<str.length();i++){ strArr[i] = str.substring(i,i+1); } Collator collator = Collator.getInstance(locale); Arrays.sort(strArr, collator); StringBuffer strBuf = new StringBuffer(); for (String string : strArr) { strBuf.append(string); } return strBuf.toString(); }
source share