[][src]Function encoding_rs::mem::convert_utf8_to_utf16_without_replacement

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

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.