I have the following problem. I am trying to replace german umlauts like ä, ö, ü in java. But it simply does not work. Her
i had to modify the answer of user1438038:
private static String replaceUmlaute(String output) {
String newString = output.replace("\u00fc", "ue")
.replace("\u00f6", "oe")
.replace("\u00e4", "ae")
.replace("\u00df", "ss")
.replaceAll("\u00dc(?=[a-z\u00e4\u00f6\u00fc\u00df ])", "Ue")
.replaceAll("\u00d6(?=[a-z\u00e4\u00f6\u00fc\u00df ])", "Oe")
.replaceAll("\u00c4(?=[a-z\u00e4\u00f6\u00fc\u00df ])", "Ae")
.replace("\u00dc", "UE")
.replace("\u00d6", "OE")
.replace("\u00c4", "AE");
return newString;
}
This should work on any target platform (i had problems on a tomcat on windows).