public interface AsciiConverter
AsciiConverter converts Unicode to simple 7-bit ASCII characters. It strips diacritic marks and transliterates non-Latin letters and glyphs to ASCII.
It is optimized for performance and does not implement perfectly correct transliteration (e.g. it has no state to transliterate a code-point dependening on
its predecessors).However, it is very helpful to decode strings for use-cases like indexing and searching or if you want to build a
String to be used for restricted
environments (names of files, folders, etc.) where special characters could cause problems.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionconvert(int codePoint) default Stringconvert(CharSequence text) convert(CharSequence text, AsciiConverterConfig config) static AsciiConverterget()
-
Method Details
-
convert
-
convert
- Parameters:
text- the (unicode)CharSequenceto convert.- Returns:
- the converted ASCII representation of the given
text.
-
convert
- Parameters:
text- the (unicode)CharSequenceto convert.config- theAsciiConverterConfig.- Returns:
- the converted ASCII representation of the given
text.
-
get
- Returns:
- the singleton instance of
AsciiConverter.
-