Skip to main content

escape_for_parser

Function escape_for_parser 

Source
fn escape_for_parser(value: &str) -> String
Expand description

Quote and escape value using only the escape sequences that parser::split_line recognises (\\, \", \n, \t, \r, \0).

Avoids format!("{:?}", …) because Rust’s Debug impl also emits \u{N} for non-printable Unicode, which the parser does not understand and would silently corrupt on the next read.