-
containers
-
containers.data
-
containers.monomorphic
-
containers.sexp
-
containers.top
Library
Module
Module type
Parameter
Class
Class type
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
- since 2.1
type uchar = Uchar.t
val hash : t -> int
val pp : Format.formatter -> t -> unit
val to_string : t -> string
Identity.
Generator of unicode codepoints.
- parameter idx
offset where to start the decoding.
Iter of unicode codepoints.
- parameter idx
offset where to start the decoding.
List of unicode codepoints.
- parameter idx
offset where to start the decoding.
val n_chars : t -> int
Number of characters.
val n_bytes : t -> int
Number of bytes.
val of_string_exn : string -> t
Validate string by checking it is valid UTF8.
- raises Invalid_argument
if the string is not valid UTF8.
val of_string : string -> t option
Safe version of of_string_exn
.
val unsafe_of_string : string -> t
Conversion from a string without validating. Upon iteration, if an invalid substring is met, Malformed will be raised.