Codepoint¶
Public Functions¶
scalar¶
The underlying U32 scalar value.
Returns¶
- U32 val
category¶
UAX #44 General Category of this codepoint.
Returns¶
combining_class¶
Canonical Combining Class. Most codepoints return 0 (Not_Reordered); only combining marks have non-zero values.
Returns¶
- U8 val
canonical_decomposition¶
Canonical Decomposition_Mapping per UAX #44. Returns None for
codepoints with no canonical decomposition (including Hangul
syllables — their decomposition is algorithmic).
Returns¶
is_letter¶
True iff this codepoint's General Category is one of the Letter categories: Lu, Ll, Lt, Lm, Lo.
Returns¶
- Bool val
is_digit¶
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.
Returns¶
- Bool val
is_whitespace¶
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.
Returns¶
- Bool val
is_assigned¶
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.
Returns¶
- Bool val
script¶
The Script property of this codepoint per Scripts.txt. Returns
ScriptUnknown for codepoints with no assigned script.
Returns¶
script_extensions¶
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()].
Returns¶
has_property¶
True iff this codepoint has the binary property p per
PropList.txt, DerivedCoreProperties.txt, or emoji-data.txt.
Parameters¶
Returns¶
- Bool val
east_asian_width¶
The East_Asian_Width property of this codepoint per UAX #11.
Returns EAWN (Neutral) for codepoints with no explicit
assignment.
Returns¶
eq¶
Parameters¶
- that: Codepoint box
Returns¶
- Bool val
lt¶
Parameters¶
- that: Codepoint box
Returns¶
- Bool val
hash¶
Returns¶
- USize val
string¶
Hex representation in the form U+XXXX (with 4 or more hex digits
as needed). Suitable for debug output and error messages.
Returns¶
- String iso^