fn escape_str(wr: &mut dyn Write, v: &str) -> EncodeResult