Table 1: Error codes.

Code Meaning
OK Initial state, no error
RD_LEAD_INVAL Invalid UTF-8 leading octet found
RD_CONT_INVAL Invalid UTF-8 continuation octet found
RD_EOF End of file, input failed
RD_NONSHORT Nonshortest UTF-8 encoding found
RD_UNICODE_INVAL Invalid Unicode code-point found
RD_OVERFLOW Overflow, internal UTF-32 character type too small
WR_EOF End of file, output failed
WR_UNICODE_INVAL Invalid internal UTF-32 character