Function encoding_rs::mem::convert_str_to_utf16[][src]

pub fn convert_str_to_utf16(src: &str, dst: &mut [u16]) -> usize
Expand description

Converts valid UTF-8 to valid UTF-16.

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

Returns the number of u16s written.

Panics

Panics if the destination buffer is shorter than stated above.