fnbidi
pub fn bidi(Char) -> Bidi
The bidirectional class of ch, with the defaults the UCD assigns to unassigned code points.
What a character is and how it changes case.
pub fn bidi(Char) -> Bidi
The bidirectional class of ch, with the defaults the UCD assigns to unassigned code points.
pub fn category(Char) -> Category
The category of ch; unassigned code points are Cn.
pub fn fold(StringView) -> String
text case-folded with the full foldings, for caseless comparison.
pub fn has(Char, Property) -> Bool
Whether ch has property.
pub fn lower(StringView) -> String
text in lowercase, with the full mappings; a capital sigma at the end of a word becomes ς.
pub fn numeric(Char) -> Numeric?
The numeric type of ch; None for characters without a numeric value.
pub fn title(StringView) -> String
Every character of text mapped to its titlecase form. Words are not found here: callers decide which characters start one.
pub fn upper(StringView) -> String
text in uppercase, with the full mappings: ß becomes SS.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
Bidi_Class.
pub(all) enum Bidi {
Implements Show.
General_Category.
pub(all) enum Category {
Implements Show.
Numeric_Type, for characters that have one.
pub(all) enum Numeric {
A binary property from PropList, DerivedCoreProperties and emoji-data.
pub(all) enum Property {
The Unicode version that first assigned a code point.
pub fn age(Char) -> (Int32, Int32)?
When ch was first assigned, as the (major, minor) Unicode version — (1, 1) for the original repertoire, (17, 0) for the newest — or None for code points that are still unassigned.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
The block a code point sits in, and the range of a block.
pub fn block(Char) -> String?
The block ch belongs to, or None for the code points that sit in no block at all.
pub fn range(StringView) -> (Char, Char)?
The first and last code point of the block called name, matched the loose way of UAX #44 (LM3): case, spaces, underscores, hyphens and a leading "is" are ignored. The short aliases of PropertyValueAliases.txt (ASCII, Greek, CJK) name their blocks too.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
The name of a code point, and the code point a name names.
pub fn lookup(StringView) -> Char?
The code point named name, matched the loose way of UAX #44 (LM2): case, spaces, underscores and medial hyphens ignored, except the hyphen in U+1180's name. Formal names and every NameAliases alias resolve; a formal name wins over an alias spelled the same.
pub fn name(Char) -> String?
The name of ch, or None when the code point has none: unassigned code points, surrogates, private use and noncharacters. Hangul syllables and the ideograph-like scripts named PREFIX-XXXX (CJK, Tangut, Khitan, Nushu, Egyptian hieroglyphs) are spelled by the Standard's rules NR1 and NR2.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
The script of a code point, and the scripts it is shared with.
pub fn extensions(Char) -> Array[Script]
The scripts ch can belong to: the ScriptExtensions.txt list when it has one, and [script(ch)] when it does not.
pub fn script(Char) -> Script
The script of ch; unassigned and unknown code points are Unknown.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
Script, the writing system a character belongs to. The long name is what Show writes; Script::of reads both it and the four-letter code.
pub(all) enum Script {
Implements Show.
pub fn Script::of(StringView) -> Self?
The script called name — a long name ("Latin", "Old Italic") or a four-letter code ("Latn", "Ital"), matched the loose way of UAX #44 (LM3): case, spaces, underscores, hyphens and a leading "is" are ignored.
The four normalization forms of UAX #15, combining classes and decompositions.
pub fn combining(Char) -> Int32
The Canonical_Combining_Class of ch (0 when it has none).
pub fn decomposition(Char) -> String
The first-level decomposition mapping of ch, as the UCD lists it: a space separated, upper-case, four-digit-hex sequence, or "" when ch has none.
pub fn is_normalized(Form, StringView) -> Bool
True when s is already in form (no change under normalize).
pub fn normalize(Form, StringView) -> String
s in form — NFC, NFD, NFKC or NFKD — exactly as Unicode defines it: decompose recursively, put the sequence in canonical order, then compose the decomposed form when form is a composed one.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
A Unicode normalization form. NFC and NFKC are the composed forms; NFD and NFKD are the decomposed forms.
pub(all) enum Form {
Implements Show.
Terminal cells and East Asian Width.
pub fn east_asian_width(Char) -> Eaw
The East Asian Width of ch (see Eaw).
pub fn text_width(StringView, ambiguous? : Int32) -> Int32
The number of terminal cells s occupies, or -1 when it holds a control character. A Zero Width Joiner hides the character after it, so an emoji sequence counts once, and a Variation Selector 16 (U+FE0F) after a character that takes an emoji presentation widens it by one cell. ambiguous is as for width.
pub fn version() -> String
The version of the Unicode Character Database the width data comes from.
pub fn width(Char, ambiguous? : Int32) -> Int32
The number of terminal cells ch occupies: -1 for C0 and C1 control characters, 0 for NUL, combining marks and other zero-width code points, 2 for Wide and Fullwidth code points, and 1 otherwise. ambiguous is the width an East Asian Ambiguous character takes where it would otherwise take one cell; a CJK terminal draws them two wide.
The East Asian Width of ch, the UCD ea property: a code point is Wide (W) or Fullwidth (F) in two cells, Narrow (Na) or Halfwidth (H) in one, Ambiguous (A) depends on context, and Neutral (N) defaults to one. Unassigned code points and surrogates are Neutral.
pub(all) enum Eaw {
Implements Show.
Grapheme clusters, words and sentences, by UAX #29.
pub fn gcb_property(Char) -> Gcb
The Grapheme_Cluster_Break property value of a character.
pub fn grapheme_at(StringView, Int32) -> (Int32, Int32)
The grapheme cluster holding the UTF-16 offset at, as (start, end): where a cursor lands when it moves one user-perceived character.
pub fn grapheme_boundaries(Array[Int32]) -> Array[Bool]
Grapheme cluster boundaries: result[i] is true when a boundary falls between cps[i] and cps[i + 1], following UAX #29.
pub fn grapheme_clusters(StringView) -> Array[String]
The extended grapheme clusters of a string.
pub fn sb_property(Char) -> Sb
The Sentence_Break property value of a character.
pub fn sentence_boundaries(Array[Int32]) -> Array[Bool]
Sentence boundaries, following UAX #29.
pub fn sentences(StringView) -> Array[String]
The sentences of a string.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
pub fn wb_property(Char) -> Wb
The Word_Break property value of a character.
pub fn word_at(StringView, Int32) -> (Int32, Int32)
The word, or run of spaces or punctuation, holding the UTF-16 offset at, as (start, end): what a double click selects.
pub fn word_boundaries(Array[Int32]) -> Array[Bool]
Word boundaries, following UAX #29.
pub fn words(StringView) -> Array[String]
The words of a string.
A Grapheme_Cluster_Break property value.
pub(all) enum Gcb {
Implements Show.
A Sentence_Break property value.
pub(all) enum Sb {
Implements Show.
A Word_Break property value.
pub(all) enum Wb {
Implements Show.
Line-break opportunities, by UAX #14.
pub fn breaks(StringView) -> Array[(Int32, Bool)]
The break opportunities inside s, as the UTF-16 offset each line may end at and whether the line must end there (after a hard line break) or only may.
pub fn lb_property(Char) -> Lb
The line-break class of a character.
pub fn linebreak_boundaries(Array[Int32]) -> Array[Bool]
The line-break boundaries of a code point sequence: result[i] is true when a break opportunity falls between cps[i] and cps[i + 1], following UAX #14.
pub fn linebreaks(StringView) -> Array[String]
The line-break opportunities of a string.
pub fn version() -> String
The version of the Unicode Character Database the tables come from.
A line-break class, after the LB1 resolution the algorithm applies.
pub(all) enum Lb {
Implements Show.