UTF-32 iterators #
UTF32.decodeIter reads characters from UTF-32 code units, and UTF32.encodeIter writes them back.
A code unit that is a surrogate or above U+10FFFF is ill-formed.
The UTF-32 encoding form, as a decoder from code units and an encoder to code units.
Instances For
Equations
Decodes one character from the UTF-32 code units of it. Calls yield with the character and the
iterator after it, error with the iterator after a code unit that is not a scalar value, or
done at the end of the input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Unicode.UTF32.instEncoderCharUInt32 = { length := fun (x : Unicode.UTF32) (x_1 : Char) => 1, unit := fun (x : Unicode.UTF32) (c : Char) (x_1 : Nat) => c.val }
Decodes the UTF-32 code units of it, stopping at the first that is not a scalar value.
A for loop or fold over the result ends at ill-formed input just as at the end of the input. To
tell them apart, fold with decodeFold, which also returns the iterator where decoding stopped, and
check decodeError? there, find the first ill-formed input ahead with decodeFailure?, or decode
with decodeIterLossy instead.
Equations
Instances For
Decodes the UTF-32 code units of it, replacing each that is not a scalar value with
U+FFFD.
Equations
Instances For
Encodes the characters of it as UTF-32 code units.