package xapi-stdext-encodings

  1. Overview
  2. Docs

Provides functions for validating and processing * strings according to the UTF-8 character encoding, * with certain additional restrictions on UCS values * imposed by the XML specification. * * Validly-encoded strings must satisfy both RFC 3629 * and section 2.2 of the XML specification. * * For further information, see: * http://www.rfc.net/rfc3629.html * http://www.w3.org/TR/REC-xml/#charsets

val is_valid : string -> bool

Returns true if and only if the given string is validly-encoded.

val validate : string -> unit

Raises an encoding error if the given string is not validly-encoded.

val longest_valid_prefix : string -> string

Returns the longest validly-encoded prefix of the given string.

OCaml

Innovation. Community. Security.