Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code shared from the Rust Playground
fn main() {
let message = "“It’s a smart quote!” 😛";
let new_message: String = message
.bytes()
.enumerate()
.map(|(i, c)| {
println!("[{:3}] = {:08b} = {:02x} = '{}'", i, c, c, c as char);
c as char
})
.collect();
println!("{}", new_message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment