Java Utililty Methods String Diacritics

List of utility methods to do String Diacritics

Description

The list of methods to do String Diacritics are organized into topic(s).

Method

StringremoveDiacriticalMarks(String string)
remove Diacritical Marks
return Normalizer.normalize(string, Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
StringremoveDiacriticals(final String s)
Turns accented characters in the specified string into their non-accented counterparts.
return Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
StringremoveDiacritics(String input)
remove Diacritics
String nrml = Normalizer.normalize(input, Normalizer.Form.NFD);
StringBuilder stripped = new StringBuilder();
for (int i = 0; i < nrml.length(); ++i) {
    if (Character.getType(nrml.charAt(i)) != Character.NON_SPACING_MARK) {
        stripped.append(nrml.charAt(i));
return stripped.toString();
...
StringremoveDiacritics(String input)
remove Diacritics
String normalized = Normalizer.normalize(input, Form.NFKD);
String cleared = normalized.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
return cleared;
StringremoveDiacritics(String st)
Remove diacritics (i.e., accents) from String
st = Normalizer.normalize(st, Normalizer.Form.NFD);
return st.replaceAll("[^\\p{ASCII}]", "");
StringremoveDiacritics(String text)
remove Diacritics
String nfdNormalizedString = Normalizer.normalize(text, Normalizer.Form.NFD);
return removeDiacriticPattern.matcher(nfdNormalizedString).replaceAll("");
StringremoveDiacritics(String word)
Remove diacritics from word.
String tmpWord = Normalizer.normalize(word, Normalizer.Form.NFD);
StringBuilder newWord = new StringBuilder();
char[] chars = tmpWord.toCharArray();
for (char c : chars) {
    if (Character.getType(c) != Character.NON_SPACING_MARK
            && Character.getType(c) != Character.COMBINING_SPACING_MARK
            && Character.getType(c) != Character.ENCLOSING_MARK) {
        newWord.append(c);
...