Import with #import "std/unicode".

CaseFold :: (text: string) -> Text

Full default (non-Turkic) case folding, including multi-scalar expansions.

Lower :: (text: string) -> Text

Full default lowercase, including the contextual Greek final sigma rule.

LowerInto :: (text: string, output: *Vec(u8)) -> bool

Replace caller-owned output with full default lowercase, including final sigma. Unlike Lower, reject malformed UTF-8. Input must not borrow output. Empty input succeeds; every failure empties output (capacity may remain).

NFCInto :: (text: string, output: *Vec(u8)) -> bool

Canonical Unicode normalization; same ownership/failure contract as LowerInto. No compatibility decomposition or locale tailoring.

IsLetter :: (point: u32) -> bool

Exact General_Category L and N aggregates, and Unicode White_Space. White_Space excludes Python IsSpace's extra U+001C..U+001F controls.

IsNumber :: (point: u32) -> bool
IsWhiteSpace :: (point: u32) -> bool
Capitalize :: (text: string) -> Text

Python str.capitalize: titlecase the first scalar, lowercase the remainder.

IsWord :: (codepoint: u32) -> bool

Python Unicode regex \w: letters, numeric characters, and underscore.

IsDecimal :: (codepoint: u32) -> bool

Python Unicode regex \d: decimal digits, General_Category Nd only.

IsPrintable :: (codepoint: u32) -> bool

Python-style printability at Unicode 17.0: L/M/N/P/S categories and ASCII space. All other separators, controls, formats, private-use and unassigned characters are excluded. This describes text, not font glyph availability.

IsSpace :: (codepoint: u32) -> bool

Python str.isspace / regex \s, including U+001C..U+001F.

IsWhitespace :: (text: string) -> bool

Python str.isspace: empty text is false. Invalid UTF-8 is not whitespace.

SplitWhitespace :: (text: string) -> Vec(string)

Python str.split() without a separator: collapse whitespace runs and omit empty pieces. Returned pieces borrow text; keep its storage alive.

Source ↗ · All modules