module Gutf8:sig..end
Pure ocaml module for conversion between UCS and UTF8
typeunichar =int
typeunistring =unichar array
val from_unichar : unichar -> stringfrom_unichar 0xiii converts a code point iii (usually in hexadecimal
form) into a string containing the UTF-8 encoded character 0xiii. See
unicode.org for charmaps.
Does not check that the given code point is a valid unicode point.
val from_unistring : unistring -> string
val to_unichar_validated : string -> pos:int Stdlib.ref -> unicharto_unichar_validated decodes an UTF-8 encoded code point and checks
for incomplete characters, invalid characters and overlong encodings.
Convert.Error if invalidval to_unichar : string -> pos:int Stdlib.ref -> unicharto_unichar decodes an UTF-8 encoded code point. Result is undefined
if pos does not point to a valid UTF-8 encoded character.
val to_unistring : string -> unistringto_unistring decodes an UTF-8 encoded string into an array of
unichar. The string must be valid.
val first_char : string -> unicharfirst_char returns the first UTF-8 encoded code point.
val next : string -> pos:int -> intnext returns the position of the code point following the one at pos.
val length : string -> intlength returns the number of code-points in the UTF-8 encode string
module Error:sig..end
to_unichar_validated may raise PARTIAL_INPUT or ILLEGAL_SEQUENCE