You can use the Unicode \p{InCombiningDiacriticalMarks} block property to remove (most) diacritics from strings:
public String normalize(String input) { String output = Normalizer.normalize(input, Normalizer.Form.NFD); Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); return pattern.matcher(output).replaceAll(""); }
This will not replace the German umlauts as you want. He will turn ö into o , ä into a and so on. But perhaps this is also good for you.
source share