pub fn convert_utf8_to_utf16_without_replacement(
    src: &[u8],
    dst: &mut [u16]
) -> Option<usize>
Expand description

Converts potentially-invalid UTF-8 to valid UTF-16 signaling on error.

The length of the destination buffer must be at least the length of the source buffer.

Returns the number of u16s written or None if the input was invalid.

When the input was invalid, some output may have been written.

Panics

Panics if the destination buffer is shorter than stated above.