OCaml Library Collection
/

Character encoding detection and handling

type t = [
  1. | `Utf8
  2. | `Utf16be
  3. | `Utf16le
  4. | `Utf32be
  5. | `Utf32le
]
val to_string : t -> string

Convert encoding to string representation

val pp : Format.formatter -> t -> unit

Pretty-print an encoding

val detect : string -> t * int

Detect encoding from BOM or first bytes. Returns (encoding, bom_length)

val equal : t -> t -> bool

Test equality of two encodings