There is no built-in method for this, so you need to create your own:
Part of this decision is here : This first divides all the accented characters into their de-ambient colleagues, and then their combined diacritics. Then you simply delete all combinations of diacritics. Also see fooobar.com/questions/38387 / ...
And then your equals method will look like this:
import java.text.Normalizer; import java.text.Normalizer.Form; public boolean equals(Object o) { // Code omitted if (yourField.equals(removeAccents(anotherField))) { return true; } } public static String removeAccents(String text) { return text == null ? null : Normalizer.normalize(text, Form.NFD) .replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); }
source share