Set the value to nonzero before decoding or encoding the last block of the byte sequence or the character sequence respectively. The value influences the conversion as below.
On decoding, in the case that the last few bytes are too short to form a valid byte sequence:
If the value is nonzero, the conversion terminates by error (MCONVERSION_RESULT_INVALID_BYTE) at the first byte of the sequence.
If the value is zero, the conversion terminates successfully. Those bytes are stored in the converter as carryover and are prepended to the byte sequence of the further conversion.
On encoding, in the case that the coding system is context dependent:
If the value is nonzero, the conversion may produce a byte sequence at the end to reset the context to the initial state even if the source characters are zero.
If the value is zero, the conversion never produce such a byte sequence at the end. |