`sig
val u_bom : Stdlib.Uchar.t
val u_rep : Stdlib.Uchar.t
type encoding = [ `UTF_16 | `UTF_16BE | `UTF_16LE | `UTF_8 ]
type decoder_encoding =
[ `ISO_8859_1 | `US_ASCII | `UTF_16 | `UTF_16BE | `UTF_16LE | `UTF_8 ]
val encoding_of_string : string -> Uutf.decoder_encoding option
val encoding_to_string : [< Uutf.decoder_encoding ] -> string
type src = [ `Channel of Stdlib.in_channel | `Manual | `String of string ]
type nln =
[ `ASCII of Stdlib.Uchar.t
| `NLF of Stdlib.Uchar.t
| `Readline of Stdlib.Uchar.t ]
type decoder
val decoder :
?nln:[< Uutf.nln ] ->
?encoding:[< Uutf.decoder_encoding ] -> [< Uutf.src ] -> Uutf.decoder
val decode :
Uutf.decoder ->
[ `Await | `End | `Malformed of string | `Uchar of Stdlib.Uchar.t ]
val decoder_encoding : Uutf.decoder -> Uutf.decoder_encoding
val set_decoder_encoding :
Uutf.decoder -> [< Uutf.decoder_encoding ] -> unit
val decoder_line : Uutf.decoder -> int
val decoder_col : Uutf.decoder -> int
val decoder_byte_count : Uutf.decoder -> int
val decoder_count : Uutf.decoder -> int
val decoder_removed_bom : Uutf.decoder -> bool
val decoder_src : Uutf.decoder -> Uutf.src
val decoder_nln : Uutf.decoder -> Uutf.nln option
val pp_decode :
Stdlib.Format.formatter ->
[< `Await | `End | `Malformed of string | `Uchar of Stdlib.Uchar.t ] ->
unit
type dst =
[ `Buffer of Stdlib.Buffer.t | `Channel of Stdlib.out_channel | `Manual
]
type encoder
val encoder : [< Uutf.encoding ] -> [< Uutf.dst ] -> Uutf.encoder
val encode :
Uutf.encoder ->
[< `Await | `End | `Uchar of Stdlib.Uchar.t ] -> [ `Ok | `Partial ]
val encoder_encoding : Uutf.encoder -> Uutf.encoding
val encoder_dst : Uutf.encoder -> Uutf.dst
module Manual :
sig
val src : Uutf.decoder -> Stdlib.Bytes.t -> int -> int -> unit
val dst : Uutf.encoder -> Stdlib.Bytes.t -> int -> int -> unit
val dst_rem : Uutf.encoder -> int
end
module String :
sig
val encoding_guess :
string -> [ `UTF_16BE | `UTF_16LE | `UTF_8 ] * bool
type 'a folder =
'a ->
int -> [ `Malformed of string | `Uchar of Stdlib.Uchar.t ] -> 'a
val fold_utf_8 :
?pos:int -> ?len:int -> 'a Uutf.String.folder -> 'a -> string -> 'a
val fold_utf_16be :
?pos:int -> ?len:int -> 'a Uutf.String.folder -> 'a -> string -> 'a
val fold_utf_16le :
?pos:int -> ?len:int -> 'a Uutf.String.folder -> 'a -> string -> 'a
end
module Buffer :
sig
val add_utf_8 : Stdlib.Buffer.t -> Stdlib.Uchar.t -> unit
val add_utf_16be : Stdlib.Buffer.t -> Stdlib.Uchar.t -> unit
val add_utf_16le : Stdlib.Buffer.t -> Stdlib.Uchar.t -> unit
end
end`