encoding_c_mem

Function encoding_mem_utf16_valid_up_to

source
#[no_mangle]
pub unsafe extern "C" fn encoding_mem_utf16_valid_up_to(
    buffer: *const u16,
    len: usize,
) -> usize
Expand description

Returns the index of the first unpaired surrogate or, if the input is valid UTF-16 in its entirety, the length of the input.

§Undefined behavior

UB ensues if buffer and buffer_len don’t designate a valid memory block or if buffer is NULL. (If buffer_len is 0, buffer may be bogus but still has to be non-NULL and aligned.)