pub fn encode(input: &str, buffer: &mut [u16]) -> Result<usize, Error>
Encodes an input UTF-8 string into a UCS-2 string.
The returned usize represents the length of the returned buffer, measured in 2-byte characters.
usize