Unicode String, in UTF8
A unicode string represented by a utf8 bytestring. This representation
is convenient for manipulating normal OCaml strings that are encoded
in UTF8.
We perform only basic decoding and encoding between codepoints and
bytestrings.
For more elaborate operations,
please use the excellent Uutf.
status: experimental
type 'a gen = unit ‑> 'a option
type 'a sequence = ('a ‑> unit) ‑> unit
val equal : t ‑> t ‑> boolval compare : t ‑> t ‑> intval pp : Format.formatter ‑> t ‑> unitval to_string : t ‑> stringGenerator of unicode codepoints.
- Parameter idx: offset where to start the decoding.
Sequence of unicode codepoints.
- Parameter idx: offset where to start the decoding.
val to_list : ?idx:int ‑> t ‑> uchar listList of unicode codepoints.
- Parameter idx: offset where to start the decoding.
val fold : ?idx:int ‑> ('a ‑> uchar ‑> 'a) ‑> 'a ‑> t ‑> 'aval iter : ?idx:int ‑> (uchar ‑> unit) ‑> t ‑> unitval concat : t ‑> t list ‑> tval of_string_exn : string ‑> tValidate string by checking it is valid UTF8.
- Raises Invalid_argument: if the string is not valid UTF8.
val of_string : string ‑> t optionval is_valid : string ‑> bool
val unsafe_of_string : string ‑> tConversion from a string without validating.
Upon iteration, if an invalid substring is met, Malformed will be raised.