I want to translate my Turkish strings to lowercase in both English and Turkish locale. I\'m doing this:
String myString=\"YAŞAT BAYRI\";
Locale trlocale= new Lo
If you just want the string in ASCII, without accents, the following might do. First an accented character might be split in ASCII char and a combining diacritical mark (zero-width accent). Then only those accents may be removed by regular expression replace.
public static String withoutDiacritics(String s) {
// Decompose any ş into s and combining-,.
String s2 = Normalizer.normalize(s, Normalizer.Form.NFD);
return s2.replaceAll("(?s)\\p{InCombiningDiacriticalMarks}", "");
}