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