Surtout pour moi même : comment remplacer les caractères accentués par leur équivalent de manière simplifiés.
Un bon petit code existe dans Java 6 et supp
import java.text.Normalizer;
import java.text.Normalizer.Form;
// ...
public static String removeAccents(String text)
{
return text == null ? null
: Normalizer.normalize(text, Form.NFD)
.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
}
source : http://www.drillio.com/en/software-development/java/removing-accents-diacritics-in-any-language/
comments powered by Disqus