Function raw2utf8

Source
pub unsafe fn raw2utf8(
    data: *const c_char,
    length: usize,
) -> Result<String, Utf8Error>
Expand description

Convert C pointer-and-length to Rust String. Fail if it is not valid UTF-8.

ยงSafety

Safety concerns are identical to std::slice::from_raw_parts; please see those docs for details.