module Encoding:sig..end
typet =string
Type of a character encoding
val equal : t -> t -> boolequal e1 e2 returns whether e1 and e2 denotes the same
encoding. It does a caseless comparison of e1 or e2 without
optionnal suffixes ("//IGNORE" or "//TRANSLIT").
val system : tThe character encoding used by the system
typecode_point =int
Type of a unicode code-point.
val recode_string : src:t -> dst:t -> string -> stringrecode_string ~src ~dst str recode str from src encoding
to dst encoding.
type decoder
Type of a decoder
val decoder : t -> decoderCreates a decoder from an encoding-name
type decoding_result =
| |
Dec_ok of |
(* |
| *) |
| |
Dec_need_more |
(* |
| *) |
| |
Dec_error |
(* |
| *) |
Result of a decoding operation
val decode : decoder -> string -> int -> int -> decoding_resultdecode decoder buffer ptr len decodes with decoder bytes at
position ptr in buffer
type encoder
Type of an encoder
val encoder : t -> encoderCreates an encoder from an encoding-name
type encoding_result =
| |
Enc_ok of |
(* |
| *) |
| |
Enc_need_more |
(* |
| *) |
| |
Enc_error |
(* |
| *) |
Result of an encoding operation
val encode : encoder ->
string -> int -> int -> code_point -> encoding_resultencode decoder buffer ptr len code encodes code with
encoder at position ptr in buffer