Here you can find the source of stripAccents(String input)
public static String stripAccents(String input)
//package com.java2s; //License from project: Open Source License import java.text.Normalizer; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; public class Main { private static Pattern findAccentsPattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); private static Map<Character, Character> visualEquivalents = new HashMap<>(); public static String stripAccents(String input) { if (input == null) { return null; }//from w w w.j a v a 2 s .c o m final String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD); // Note that this doesn't correctly remove ligatures... String stripped = findAccentsPattern.matcher(decomposed).replaceAll(""); for (Map.Entry<Character, Character> e : visualEquivalents.entrySet()) { stripped = stripped.replace(e.getKey(), e.getValue()); } return stripped; } }