Skip to content

Codepoint

[Source]

class val Codepoint

Public Functions

scalar

[Source]

The underlying U32 scalar value.

fun box scalar()
: U32 val

Returns


category

[Source]

UAX #44 General Category of this codepoint.

fun box category()
: Category

Returns


combining_class

[Source]

Canonical Combining Class. Most codepoints return 0 (Not_Reordered); only combining marks have non-zero values.

fun box combining_class()
: U8 val

Returns


canonical_decomposition

[Source]

Canonical Decomposition_Mapping per UAX #44. Returns None for codepoints with no canonical decomposition (including Hangul syllables — their decomposition is algorithmic).

fun box canonical_decomposition()
: (Array[U32 val] val | None val)

Returns


is_letter

[Source]

True iff this codepoint's General Category is one of the Letter categories: Lu, Ll, Lt, Lm, Lo.

fun box is_letter()
: Bool val

Returns


is_digit

[Source]

True iff General Category is Decimal_Number (Nd). Letter-number (Nl, e.g., Roman numerals) and other-number (No) are NOT considered digits by this predicate.

fun box is_digit()
: Bool val

Returns


is_whitespace

[Source]

True iff this codepoint is whitespace per a category-based approximation: General Category in {Zs, Zl, Zp} plus a few specific ASCII / Latin-1 control codes (HT, LF, VT, FF, CR, NEL).

NOTE: this is NOT the full UAX #44 White_Space property — the full version requires the PropList.txt-derived table (lands with M3b). For the common case of "is this an ASCII or Unicode space separator," the category-based answer matches.

fun box is_whitespace()
: Bool val

Returns


is_assigned

[Source]

True iff this codepoint is assigned in the bundled UCD — i.e., its General Category is anything other than Cn (Unassigned). Use this to detect input that may contain codepoints from a newer Unicode version than this package was built against.

fun box is_assigned()
: Bool val

Returns


script

[Source]

The Script property of this codepoint per Scripts.txt. Returns ScriptUnknown for codepoints with no assigned script.

fun box script()
: Script

Returns


script_extensions

[Source]

The Script_Extensions property per UAX #24. Returns the set of scripts that use this codepoint; for codepoints not listed in ScriptExtensions.txt the result is [script()].

fun box script_extensions()
: Array[Script] val

Returns


has_property

[Source]

True iff this codepoint has the binary property p per PropList.txt, DerivedCoreProperties.txt, or emoji-data.txt.

fun box has_property(
  p: BinaryProperty)
: Bool val

Parameters

Returns


east_asian_width

[Source]

The East_Asian_Width property of this codepoint per UAX #11. Returns EAWN (Neutral) for codepoints with no explicit assignment.

fun box east_asian_width()
: EastAsianWidth

Returns


eq

[Source]

fun box eq(
  that: Codepoint box)
: Bool val

Parameters

Returns


lt

[Source]

fun box lt(
  that: Codepoint box)
: Bool val

Parameters

Returns


hash

[Source]

fun box hash()
: USize val

Returns


string

[Source]

Hex representation in the form U+XXXX (with 4 or more hex digits as needed). Suitable for debug output and error messages.

fun box string()
: String iso^

Returns