Function stfu8::encode_pretty
[−]
[src]
pub fn encode_pretty(v: &[u8]) -> String
Decode stfu8 text as binary, escaping all non-printable characters EXCEPT:
- \t
: tab
- \n
: line feed
- \r
: cariage return
This will allow the encoded text to print "pretilly" while still escaping invalid unicode and other non-printable characters.
Examples
let encoded = stfu8::encode_pretty(b"foo\xFF\nbar"); assert_eq!( encoded, "foo\\xFF\nbar" );