Function ucs2::encode

source ·
pub fn encode(input: &str, buffer: &mut [u16]) -> Result<usize, Error>
Expand description

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.