Expand description
Utilities for Unicode, including:
- Character descriptions, annotations, aliases, and meanings
- Conversion of scalars to surrogates and vice versa
- UCS-2 encoding and decoding from scalars
Re-exports§
pub use character_description::ControlNameFormat;pub use character_description::DescriptionMode;pub use character_description::DescriptionOptions;pub use character_description::UnicodeVersion;pub use character_description::describe;pub use character_description::describe_codepoint;pub use character_description::describe_codepoint_with_options;pub use character_description::describe_with_options;
Modules§
- character_
description - Independent reimplementation of Andrew West’s “What Unicode Character is This” tool.
- cli
- CLI execution helpers for Unicode character descriptions.
Structs§
- Bidi
Class - Enumerated property
Bidi_Class - Canonical
Combining Class - Property
Canonical_Combining_Class. See UAX #15: https://www.unicode.org/reports/tr15/. - Unicode
Char Record - Character metadata record for generating the unified Unicode character table.
- Unicode
Data Tables - Complete dataset tables for a specific Unicode version.
Enums§
- General
Category - Enumerated property
General_Category.
Constants§
Functions§
- bidi_
class_ code - Returns the standard Bidi class abbreviation for a code point (e.g. “L”, “R”, “BN”).
- combine_
surrogates - Combines surrogate pairs in an iterator of code units into Unicode scalar values. Unpaired surrogates are left as-is.
- combining_
class - Returns the canonical combining class for a code point (0..=254).
- describe_
general_ category - Expand a Unicode general category abbreviation into a human-readable description.
- find_
block - Finds the block name for a codepoint in Unicode 17.0.
- find_
block_ with_ version - Finds the block name for a codepoint in the given version if it belongs to one.
- general_
category - Returns the Unicode General Category for a character using compiled ICU4X data.
- general_
category_ code - Returns the 2-letter general category code for a code point (e.g. “Lu”, “Cc”).
- get_
assigned_ unicode_ records - Iterates over all assigned Unicode characters and produces structured records.
- get_
tables - get_
unicode_ name - Returns the official canonical Unicode character name for a code point in the current supported Unicode standard, including standard names, control character names, and algorithmic names.
- get_
unicode_ name_ for_ version - Returns the official canonical Unicode character name for a code point for a specific Unicode version, including standard names, control character names, and algorithmic names.
- is_
assigned_ unicode - Checks if a codepoint is an assigned character in Unicode 17.0.
- is_
deprecated_ unicode - Returns true if the character is marked deprecated in the Unicode standard.
- is_
format_ char - Returns true if the character belongs to General Category Cf (Format).
- is_
known_ unicode_ name - Returns true if a given name matches any canonical or aliased Unicode character name.
- is_
nfc_ normalized - Returns true if a UTF-8 string is already in Unicode Normalization Form C (NFC).
- is_
valid_ unicode_ script - Checks if a string is a valid Unicode script name (e.g. “Latin”, “Arabic”, “Common”).
- js_
like_ slice_ utf16 - normalize_
nfc - Normalizes a UTF-8 string into Unicode Normalization Form C (NFC).
- scalars_
to_ string_ lossy - scalars_
to_ unpaired_ surrogates - Converts a slice of Unicode scalar values (
u32) to unpaired surrogates. Codepoints above U+FFFF are split into surrogate pairs. Returns an error for invalid codepoints. - script_
name - Returns the canonical script name for a code point (e.g. “Latin”, “Arabic”, “Common”).
- string_
to_ scalars - u16_
vec_ to_ le_ bytes - ucs2decode
- Decodes a slice of UCS-2/UTF-16 code units (
u16) into Unicode scalar values (u32). Surrogate pairs are combined into scalars; unpaired surrogates are left as-is. - ucs2encode
- Encodes an array of Unicode scalar values (
u32) to UTF-16/UCS-2 code units (Vec<u16>). Surrogate pairs are generated for codepoints above U+FFFF. Returns an error for invalid codepoints. - unpaired_
surrogates_ to_ scalars - Decodes a slice of code units (
u32), combining surrogate pairs into scalars. Unpaired surrogates are left as-is.