Function encoding_c::decoder_max_utf16_buffer_length [] [src]

#[no_mangle]
pub unsafe extern fn decoder_max_utf16_buffer_length(decoder: *const Decoder,
                                                     u16_length: usize)
                                                     -> usize

Query the worst-case UTF-16 output size (with or without replacement).

Returns the size of the output buffer in UTF-16 code units (char16_t) that will not overflow given the current state of the decoder and byte_length number of additional input bytes.

Since the REPLACEMENT CHARACTER fits into one UTF-16 code unit, the return value of this method applies also in the _without_replacement case.

Undefined behavior

UB ensues if decoder is NULL.