to_string_lossy

Function to_string_lossy 

Source
pub(crate) fn to_string_lossy(slice: &Wtf8) -> Cow<'_, str>
🔬This is a nightly-only experimental API. (wtf8_internals)
Expand description

Lossily converts the string to UTF-8. Returns a UTF-8 &str slice if the contents are well-formed in UTF-8.

Surrogates are replaced with "\u{FFFD}" (the replacement character “�”).

This only copies the data if necessary (if it contains any surrogate).