markup

Error-recovering functional HTML5 and XML parsers and writers
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library markup
Module Markup . Encoding
type t

Decoders. These are notionally maps from byte streams to Unicode scalar value streams, i.e. pseudocode type char stream -> int stream.

val decode : ?report:( location -> Error.t -> unit ) -> t -> ( char, 's ) stream -> ( int, 's ) stream

Applies a decoder to a byte stream. Illegal input byte sequences result in calls to the error handler ~report with error kind `Decoding_error. The illegal bytes are then skipped, and zero or more U+FFFD replacement characters are emitted. The default handler ignores errors.

The locations provided to the error handler by the built-in decoders below in this module are fully accurate only if the input byte stream uses LF characters as line breaks.

val utf_8 : t
val utf_16be : t
val utf_16le : t
val utf_16 : t
val iso_8859_1 : t
val us_ascii : t
val windows_1251 : t
val windows_1252 : t
val ucs_4be : t
val ucs_4le : t
val ucs_4be_transposed : t
val ucs_4le_transposed : t
val ebcdic : t

Code page 37.