Here you can find the source of removeDiacritics(String input)
public static String removeDiacritics(String input)
//package com.java2s; //License from project: Open Source License import java.text.Normalizer; import java.text.Normalizer.Form; public class Main { public static String removeDiacritics(String input) { // Normalizer.normalise() converts each accented // character into 1 non-accented character followed // by 1 or more characters representing the accent(s) // alone. These characters representing only // an accent belong to the Unicode category // CombiningDiacriticalMarks. The call to replaceAll // strips out all characters in that category. String normalized = Normalizer.normalize(input, Form.NFKD); String cleared = normalized.replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); return cleared; }//from w w w. j a v a2 s . c o m }