Utf8.DecoderA character decoder has some valid initial value init. In order to decode a character bytes has to be pushed into the decoder by put until the decoder is either complete (is_complete) or has encoutered some decoding error (has_error).
If the decoding is complete the decoded unicode character is returned by uchar. As long as the scan is not complete or if the scan has encountered some decoding error the function uchar returns rep = U+FFFD.
val is_complete : t -> boolHas the unicode character been completely scanned?
val has_error : t -> boolHas the scanning of the unicode character encountered an encoding error?
val uchar : t -> Stdlib.Uchar.tThe unicode character. In case of an error or a not yet completed scan, the unicode character rep = U+FFFD is returned.
val scalar : t -> intThe scalar value of the unicode character.
val width : t -> intThe visible width of the unicode character.
val byte_width : t -> intNumber of bytes used during decoding.
val is_newline : t -> boolIs the decoded character a newline character?
val init : tInitial value representing the completely scanned unicode character U+0000.
The following assertions are valid:
is_complete initnot (has_error init)