@[reducible, inline]
Determines if the given integer is a valid Unicode scalar value.
Note that values in [0xd800, 0xdfff]
are reserved for UTF-16 surrogate pairs.
Instances For
Equations
- a.instDecidableLt b = a.val.decLt b.val
Equations
- a.instDecidableLe b = a.val.decLe b.val
theorem
Char.isValidChar_of_isValidCharNat
(n : Nat)
(h : isValidCharNat n)
:
isValidChar (UInt32.ofNat' n ⋯)
The numbers from 0 to 256 are all valid UTF-8 characters, so we can embed one in the other.
Equations
- Char.ofUInt8 n = { val := n.toUInt32, valid := ⋯ }
Instances For
@[inline]
Is the character in ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
?
Equations
- c.isAlphanum = (c.isAlpha || c.isDigit)