protocol: non-space whitespace does not round trip correctly via Encode/StreamParser
Opened this issue · 1 comments
rogpeppe commented
There are special cases in the code to escape tab, newline, carriage-return and form-feed when encoding line-protocol values.
It seems that those cases aren't respected correctly when decoding.
For example, this code fails because it can't parse the line that has been encoded.
This code fails because the value has been silently changed when round tripping.
I appreciate that the encoding conventions probably can't change, but perhaps we could consider returning an error when the encoded values include these characters, to avoid this potential trip hazard.
rogpeppe commented
Other potential round-tripping problems:
- backslash is treated as special when unquoting but not quoting
- escaped-double-quote is treated as special when unquoting (there's a
// ???
comment in the code) but not when quoting.