Expand description
§Handle Converter
handle_converter
provides functions to detect confusable Unicode characters in a
given input string and return its canonical form.
Constants§
- HANDLE_
DELIMITER - Delimiter for handles
Statics§
- CONFUSABLES
- The mapping from homoglyph character to canonical Unicode character
Functions§
- convert_
to_ canonical - Creates a new
HandleConverter
instance with a built confusables map. Converts a given string to its canonical form by stripping Unicode whitespace, replacing confusable characters, and stripping diacritical marks. The resulting string is converted to lowercase ASCII characters. - replace_
confusables - Replaces any characters in the input string that are confusable with a different character.
- split_
display_ name - Splits the given display name into its base handle and handle suffix.
- strip_
diacriticals - This function removes diacritical marks from the input string and returns a new
String
without them. - strip_
unicode_ whitespace - Strips any Unicode whitespace characters from the provided string and returns the resulting string.
- trim_
and_ collapse_ whitespace - Trims whitespace from the head and tail and collapses all other whitespace to just a single space