Skip to main content

Module unicode

Module unicode 

Source

Functions§

format_codepoint
Format a Unicode codepoint as a string in the format “U+XXXX” or “U+XXXXX” or “U+XXXXXX”, depending on the value of the codepoint. The output is always uppercase.
is_deprecated_char
Check if a Unicode character carries the Deprecated property or is otherwise discouraged from use, but still renders in most environments. These characters are discouraged from use but they still render, so they are reported without a removal fix: only the author knows what the text should say instead.
is_invisible_char
Check if a Unicode character is considered invisible according to the Unicode standard and common usage. This includes control characters, formatting characters, and other non-printing characters that do not produce a visible mark in text.
is_unsuitable_for_markup_char
The rows of UTR#20 table 3.1 that neither of the sets above already covers: visible or structural code points a markup document is meant to express with markup instead. They are not default-ignorable, so removing one would drop content or leave a paired construct half-open, and only the two tone marks have a replacement that preserves the text exactly.
normalize_codepoint
Check a Unicode codepoint token in the format “U+XXXX” or “u+XXXX”, and return a normalized version of it in the format “U+XXXX”. with uppercase letters and no leading/trailing whitespace.
parse_codepoint
Parse a codepoint token in the format “U+XXXX” or “u+XXXX” and returns the corresponding character.
parse_single_char
Parse a single character from a string, returning Some(char) if the string contains exactly one character, or None if the string is empty or contains more than one character.