Function stfu8::encode [] [src]

pub fn encode(v: &[u8]) -> String

Encode text as stfu8, escaping all non-printable characters.

Examples


let encoded = stfu8::encode(b"foo\xFF\nbar");
assert_eq!(
    encoded,
    r"foo\xFF\nbar" // notice the `r` == raw string
);