Library
Module
Module type
Parameter
Class
Class type
module UCS_validator : UCS_VALIDATOR
Given a valid UCS value, returns the canonical * number of bytes required to encode the value.
Decodes a header byte, returning a tuple (v, w) where: * v = the (partial) value contained within the byte; and * w = the total width of the encoded character, in bytes.
Decodes a continuation byte, returning the * 6-bit-wide value contained within the byte.
Decodes a single character embedded within a string. Given a string * and an index into that string, returns a tuple (value, width) where: * value = the value of the character at the given index; and * width = the width of the character at the given index, in bytes. * Raises an appropriate error if the character is invalid.
Encodes a header byte for the given parameters, where: * width = the total width of the encoded character, in bytes; * value = the most significant bits of the original UCS value.
Encodes a continuation byte from the given UCS * remainder value, returning a tuple (b, r), where: * b = the continuation byte; * r = a new UCS remainder value.