Module Gutf8
Pure ocaml module for conversion between UCS and UTF8
type unichar= inttype unistring= unichar array
val from_unichar : unichar -> stringfrom_unichar 0xiiiconverts a code pointiii(usually in hexadecimal form) into a string containing the UTF-8 encoded character0xiii. See unicode.org for charmaps. Does not check that the given code point is a valid unicode point.
val from_unistring : unistring -> stringval to_unichar_validated : string -> pos:int Stdlib.ref -> unicharto_unichar_validateddecodes an UTF-8 encoded code point and checks for incomplete characters, invalid characters and overlong encodings.- raises Convert.Error
if invalid
val to_unichar : string -> pos:int Stdlib.ref -> unicharto_unichardecodes an UTF-8 encoded code point. Result is undefined ifposdoes not point to a valid UTF-8 encoded character.
val to_unistring : string -> unistringto_unistringdecodes an UTF-8 encoded string into an array ofunichar. The string must be valid.
val first_char : string -> unicharfirst_charreturns the first UTF-8 encoded code point.
val next : string -> pos:int -> intnextreturns the position of the code point following the one atpos.
module Error : sig ... endto_unichar_validatedmay raisePARTIAL_INPUTorILLEGAL_SEQUENCE