convert_valid_utf32_to_utf8

Function convert_valid_utf32_to_utf8 

Source
pub unsafe fn convert_valid_utf32_to_utf8(
    src: *const u32,
    len: usize,
    dst: *mut u8,
) -> usize
Expand description

Convert valid UTF-32 string into UTF-8 string.

Returns the number of written code units.

This function uses native endianness.

ยงSafety

  • The input string must be valid UTF-32.
  • src and dst must be non-null and properly aligned.
  • src must be valid for reads of len * size_of::<u32>() bytes
  • dst must be valid for writes of count * size_of::<u8>() bytes, where the count is the number of code units (u8) after successful conversion.
  • The memory regions of src and dst must not overlap.