This was my solution.
In order to accommodate for the utf-8 format spec, each byte should be left padded up to 8 bits with 0.
The accepted answer's `format!("0{:b}")` does not take into consideration for characters above number 128 which did not work for me since I wasn't just working with ASCII letters.
fn main() {
let chars = "日本語 ENG €";
let mut chars_in_binary = String::from("");
for char in chars.as_bytes() {
chars_in_binary += &format!("{char:0>8b} ");
}
println!("The binary representation of the following utf8 string\n \"{chars}\"\nis\n {chars_in_binary}");
}