Compares¶
Constructors¶
create¶
Returns¶
- Compares val^
Public Functions¶
bytes¶
Lexicographic byte comparison. Total. Result is in the codepoint order if both inputs are well-formed UTF-8, since UTF-8's byte-sort order matches codepoint order.
Parameters¶
Returns¶
equal_bytes¶
True iff a and b are byte-for-byte equal. Distinct from
equal_canonical: "café" precomposed (5 bytes) and "café"
decomposed (6 bytes) are NOT byte-equal but ARE canonically
equal.
Parameters¶
Returns¶
- Bool val
equal_canonical¶
NFC-equality: true iff NFC(a) == NFC(b) byte-for-byte.
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
equal_compat¶
NFKC-equality. Folds compatibility variants (e.g., fi ligature equals 'fi'; full-width digits equal ASCII digits).
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
equal_caseless¶
Default caseless equality: fold(a) == fold(b). Ignores case differences but NOT canonical differences.
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
equal_caseless_canonical¶
UAX #21 D146 default caseless matching:
NFD(fold(NFD(a))) == NFD(fold(NFD(b))). Ignores both case and
canonical differences. The double-NFD is required because case
folding can produce non-NFD output.
Parameters¶
Returns¶
- (Bool val | InvalidUtf8 val)
eq¶
Parameters¶
- that: Compares val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Compares val
Returns¶
- Bool val