Struct jomini::Windows1252Encoding [−][src]
pub struct Windows1252Encoding;
Expand description
Decodes bytes according to the windows1252 code page
use jomini::{Windows1252Encoding, Encoding}; let encoding = Windows1252Encoding::new(); assert_eq!(encoding.decode(b"Common Sense"), "Common Sense"); assert_eq!( encoding.decode(b"\xa7GRichard Plantagenet\xa7 ( 2 / 4 / 3 / 0 )"), "§GRichard Plantagenet§ ( 2 / 4 / 3 / 0 )" ); 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"\xff"), "ÿ"); assert_eq!(encoding.decode(b"\x8a"), "Š"); assert_eq!(encoding.decode(b"\xfe\xff\xfe\xff\xfe\xff\xfe\xff\xfe\xff"), "þÿþÿþÿþÿþÿ"); assert_eq!(encoding.decode(b"hi\x81\x8a"), "hi\u{81}Š");
Implementations
Trait Implementations
impl Clone for Windows1252Encoding
[src]
impl Clone for Windows1252Encoding
[src]fn clone(&self) -> Windows1252Encoding
[src]
fn clone(&self) -> Windows1252Encoding
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Windows1252Encoding
[src]
impl Debug for Windows1252Encoding
[src]impl Default for Windows1252Encoding
[src]
impl Default for Windows1252Encoding
[src]fn default() -> Windows1252Encoding
[src]
fn default() -> Windows1252Encoding
[src]Returns the “default value” for a type. Read more
impl Encoding for Windows1252Encoding
[src]
impl Encoding for Windows1252Encoding
[src]impl Copy for Windows1252Encoding
[src]
Auto Trait Implementations
impl RefUnwindSafe for Windows1252Encoding
impl Send for Windows1252Encoding
impl Sync for Windows1252Encoding
impl Unpin for Windows1252Encoding
impl UnwindSafe for Windows1252Encoding
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more