Finally, I’ve solved it by using the Normalizer
class.
import java.text.Normalizer;
public static String stripAccents(String s)
{
s = Normalizer.normalize(s, Normalizer.Form.NFD);
s = s.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
return s;
}
More Related Contents:
- Is there a way to get rid of accents and convert a whole string to regular letters?
- Remove diacritical marks (ń ǹ ň ñ ṅ ņ ṇ ṋ ṉ ̈ ɲ ƞ ᶇ ɳ ȵ) from Unicode chars
- Converting Symbols, Accent Letters to English Alphabet
- How can I iterate through the unicode codepoints of a Java String?
- How can I replace non-printable Unicode characters in Java?
- Creating Unicode character from its number
- Java string searching ignoring accents
- Can a valid Unicode string contain FFFF? Is Java/CharacterIterator broken?
- How to properly trim whitespaces from a string in Java?
- How to replace � in a string
- How to determine if a String contains invalid encoded characters
- How to correctly compute the length of a String in Java?
- Simple way to repeat a string
- Difference between string object and string literal [duplicate]
- When should we use intern method of String on String literals
- Left padding a String with Zeros [duplicate]
- What makes reference comparison (==) work for some strings in Java?
- How do I trim a file extension from a String in Java?
- How to find a whole word in a String in Java?
- How to convert String to long in Java?
- getString Outside of a Context or Activity
- Java: String concat vs StringBuilder – optimised, so what should I do?
- How do I escape a string in Java?
- Java collections convert a string to a list of characters
- How to remove single character from a String by index
- What’s the best way to check if a String contains a URL in Java/Android?
- Replace Last Occurrence of a character in a string [duplicate]
- What is a Java String’s default initial value?
- Hints for java.lang.String.replace problem? [duplicate]
- How to convert a Java String to an ASCII byte array?