Struct jomini::Utf8Encoding
source · pub struct Utf8Encoding;
Expand description
Decodes bytes according to the utf8 standard
use jomini::{Utf8Encoding, Encoding};
let encoding = Utf8Encoding::new();
assert_eq!(encoding.decode(b"Common Sense"), "Common Sense");
assert_eq!(encoding.decode(br#"Captain \"Joe\" Rogers"#), r#"Captain "Joe" Rogers"#);
assert_eq!(encoding.decode(b"1444.11.11\n"), "1444.11.11");
assert_eq!(encoding.decode(b"J\xc3\xa5hk\xc3\xa5m\xc3\xa5hkke"), "Jåhkåmåhkke");
assert_eq!(encoding.decode("Jåhkåmåhkke".as_bytes()), "Jåhkåmåhkke");
Implementations§
source§impl Utf8Encoding
impl Utf8Encoding
Trait Implementations§
source§impl Clone for Utf8Encoding
impl Clone for Utf8Encoding
source§fn clone(&self) -> Utf8Encoding
fn clone(&self) -> Utf8Encoding
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Utf8Encoding
impl Debug for Utf8Encoding
source§impl Default for Utf8Encoding
impl Default for Utf8Encoding
source§fn default() -> Utf8Encoding
fn default() -> Utf8Encoding
Returns the “default value” for a type. Read more