unicodedata.normalize()
unicodedata.normalize() is a Python function in the Unicodedata Module category. Normalizes a Unicode string (NFC, NFKC, NFD, NFKD) for comparison. The syntax is unicodedata.normalize(form, unistr). Parameters: form, unistr. Returns: Normalized string. A typical example: unicodedata.normalize("NFC", "é") # "é" (composed)
unicodedata.normalize("NFD", "é") # "e\u0301" (decomposed). A close sibling is unicodedata.lookup(), which looks up a Unicode character by its standard name. A close sibling is unicodedata.name(), which returns the Unicode name of a character. A close sibling is unicodedata.category(), which returns the general category of a Unicode character (Lu, Ll, Nd, etc.). A close sibling is unicodedata.bidirectional(), which returns the bidirectional class of a Unicode character. More about this category: Unicode database — lookup, name, normalize, category, decimal. Related Unicodedata Module entries: unicodedata.lookup(), unicodedata.name(), unicodedata.category(), unicodedata.bidirectional(), unicodedata.decimal(), unicodedata.numeric(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.