encoding::codec::utf_8

Function from_utf8

Source
pub fn from_utf8<'a>(input: &'a [u8]) -> Option<&'a str>
Expand description

Almost equivalent to std::str::from_utf8. This function is provided for the fair benchmark against the stdlib’s UTF-8 conversion functions, as rust-encoding always allocates a new string.