pub unsafe fn convert_utf8_to_utf16le_with_errors(
src: *const u8,
len: usize,
dst: *mut u16,
) -> ResultExpand description
Convert possibly broken UTF-8 string into UTF-16LE string.
During the conversion also validation of the input string is done. This function is suitable to work with inputs from untrusted sources.
ยงSafety
srcanddstmust be non-null and properly aligned.srcmust be valid for reads oflen * size_of::<u8>()bytesdstmust be valid for writes ofcount * size_of::<u16>()bytes, where thecountis the number of code units (u16) after successful conversion.- The memory regions of
srcanddstmust not overlap.