Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created December 11, 2018 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rust-play/ad23545a55c4ce251ab72fc2c70911c5 to your computer and use it in GitHub Desktop.
Save rust-play/ad23545a55c4ce251ab72fc2c70911c5 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn main() {
let cat = '😻'; // U+1F63B // UTF8: F0 9F 98 BB
println!("val {} {:x?}", cat, cat as i32);
let cat_str = String::from("😻");
let cat_bytes = cat_str.as_bytes();
println!("val {} {:x?}", cat_str, cat_bytes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment