#![allow(unused_variables)] #![feature(string_from_utf8_lossy_owned)] fn main() { let input: Vec = b"Hello \xF0\x90\x80World".into(); let output = String::from_utf8(input).unwrap_or_else(|e| e.into_utf8_lossy()); assert_eq!(String::from("Hello �World"), output); }