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 String
convert
(CharSequence text) convert
(CharSequence text, AsciiConverterConfig config) static AsciiConverter
get()
-
Method Details
-
convert
-
convert
- Parameters:
text
- the (unicode)CharSequence
to convert.- Returns:
- the converted ASCII representation of the given
text
.
-
convert
- Parameters:
text
- the (unicode)CharSequence
to convert.config
- theAsciiConverterConfig
.- Returns:
- the converted ASCII representation of the given
text
.
-
get
- Returns:
- the singleton instance of
AsciiConverter
.
-