Skip to main content

sanitize

Function sanitize 

Source
pub fn sanitize(s: &str) -> String
Expand description

Replace every ASCII control character (0x00-0x1f and 0x7f, tabs and newlines included) with a space, so a value read out of the graph cannot forge a line break, a section header, or a terminal escape sequence.

One byte in, one byte out, so a caller’s size budget is unaffected.