What does “Stream did not contain valid UTF-8” mean?
问题 I'm creating a simple HTTP server. I need to read the requested image and send it to browser. I'm using this code: fn read_file(mut file_name: String) -> String { file_name = file_name.replace("/", ""); if file_name.is_empty() { file_name = String::from("index.html"); } let path = Path::new(&file_name); if !path.exists() { return String::from("Not Found!"); } let mut file_content = String::new(); let mut file = File::open(&file_name).expect("Unable to open file"); let res = match file.read_to