pub fn decode_u8(s: &str) -> Result<Vec<u8>, DecodeError>
Expand description
Decode a UTF-8 string containing encoded STFU-8 into binary.
Can decode the output of these functions:
Examples
let expected = b"foo\xFF\nbar";
let encoded = stfu8::encode_u8_pretty(expected);
assert_eq!(
encoded,
"foo\\xFF\nbar"
);
assert_eq!(
expected,
stfu8::decode_u8(&encoded).unwrap().as_slice()
);