Expand description

Handle Converter

handle_converter provides functions to detect confusable Unicode characters in a given input string and return its canonical form.

Constants

Statics

  • The mapping from homoglyph character to canonical Unicode character

Functions

  • 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.
  • Replaces any characters in the input string that are confusable with a different character.
  • Splits the given display name into its base handle and handle suffix.
  • This function removes diacritical marks from the input string and returns a new String without them.
  • Strips any Unicode whitespace characters from the provided string and returns the resulting string.
  • Trims whitespace from the head and tail and collapses all other whitespace to just a single space