Skip to content

stdlib/unicodeView source ↗

unicode

32 items · generated by scribe fromstdlib/unicode.fd· synced 2026-11-15

stdlib/unicode32 items

Contents

uni_to_codepoints

Decode a UTF-8 string into a Vec of codepoints (invalid bytes → U+FFFD).

pub fn uni_to_codepoints(s: str) -> Vec {

Parameters:

  • s: str

Returns: Vec

Defined at line 37


uni_encode_cp

Encode one codepoint as UTF-8.

pub fn uni_encode_cp(cp: i64) -> str {

Parameters:

  • cp: i64

Returns: str

Defined at line 71


uni_from_codepoints

Encode a Vec of codepoints into a UTF-8 string.

pub fn uni_from_codepoints(cps: Vec) -> str {

Parameters:

  • cps: Vec

Returns: str

Defined at line 96


uni_len

Number of codepoints (not bytes) in a string.

pub fn uni_len(s: str) -> i64 {

Parameters:

  • s: str

Returns: i64

Defined at line 107


uni_lower_cp

Lowercase one codepoint (ASCII, Latin-1, Latin Ext-A, Greek, Cyrillic).

pub fn uni_lower_cp(cp: i64) -> i64 {

Parameters:

  • cp: i64

Returns: i64

Defined at line 130


uni_upper_cp

Uppercase one codepoint (mirrors uni_lower_cp coverage).

pub fn uni_upper_cp(cp: i64) -> i64 {

Parameters:

  • cp: i64

Returns: i64

Defined at line 191


uni_lower

Unicode-aware lowercase.

pub fn uni_lower(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 251


uni_upper

Unicode-aware uppercase.

pub fn uni_upper(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 262


uni_equal_fold

Case-folded comparison (lowercase both sides first).

pub fn uni_equal_fold(a: str, b: str) -> bool {

Parameters:

  • a: str
  • b: str

Returns: bool

Defined at line 273


uni_is_combining

True for a codepoint in a combining-mark range (Mn/Mc approx.).

pub fn uni_is_combining(cp: i64) -> bool {

Parameters:

  • cp: i64

Returns: bool

Defined at line 284


uni_is_alpha

True for a Unicode letter (major scripts; not exhaustive).

pub fn uni_is_alpha(cp: i64) -> bool {

Parameters:

  • cp: i64

Returns: bool

Defined at line 297


uni_is_digit

True for a decimal digit (ASCII + common digit ranges).

pub fn uni_is_digit(cp: i64) -> bool {

Parameters:

  • cp: i64

Returns: bool

Defined at line 312


uni_is_space

True for whitespace per Unicode White_Space (common members).

pub fn uni_is_space(cp: i64) -> bool {

Parameters:

  • cp: i64

Returns: bool

Defined at line 321


uni_graphemes

Split a string into grapheme clusters (Vec of str). Approximation: handles combining marks, VS16 emoji, ZWJ chains, and flag pairs. Does not handle all GB9/extended-pictographic rules.

pub fn uni_graphemes(s: str) -> Vec {

Parameters:

  • s: str

Returns: Vec

Defined at line 349


uni_grapheme_len

Number of grapheme clusters (user-perceived characters).

pub fn uni_grapheme_len(s: str) -> i64 {

Parameters:

  • s: str

Returns: i64

Defined at line 395


uni_normalize_lite

Compose base+combining-mark pairs for Latin (subset of NFC).

pub fn uni_normalize_lite(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 594


uni_nfd

Canonical decomposition (NFD). Example (native only): var v = uni_to_codepoints(uni_nfd(“\u{00E9}”)); // [101, 769] — e followed by combining acute println(int_to_str(v.len()));

pub fn uni_nfd(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 730


uni_nfkd

Compatibility decomposition (NFKD). Example (native only): var v = uni_to_codepoints(uni_nfkd(“\u{00BD}”)); // [49, 8260, 50] — “1⁄2” (one, fraction slash, two) println(int_to_str(v.len()));

pub fn uni_nfkd(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 746


uni_nfc

Canonical composition (NFC) — NFD then canonical recomposition. Example (native only): if str_equal(uni_nfc(“e\u{0301}”), “\u{00E9}”) { println(“composed”); }

pub fn uni_nfc(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 762


uni_nfkc

Compatibility composition (NFKC) — NFKD then canonical recomposition. Example (native only): if str_equal(uni_nfkc(“\u{339F}”), “mm”) { println(“squared mm folded”); }

pub fn uni_nfkc(s: str) -> str {

Parameters:

  • s: str

Returns: str

Defined at line 778


Generated by scribe, the Fides documentation generator