pub unsafe fn convert_utf8_to_utf16le_with_errors(
src: *const u8,
len: usize,
dst: *mut u16,
) -> Result
Expand 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
src
anddst
must be non-null and properly aligned.src
must be valid for reads oflen * size_of::<u8>()
bytesdst
must be valid for writes ofcount * size_of::<u16>()
bytes, where thecount
is the number of code units (u16
) after successful conversion.- The memory regions of
src
anddst
must not overlap.