|
|
|
|
|
by ghusto
805 days ago
|
|
Perhaps naive, but we escape with \ everywhere else, so why not here? If you're typing in CSV manually, escape with \ If you're exporting to CSV, the program already know which part is data and which part is the next cell, so again the program can escape with \ |
|
Most good implementations are flexible enough that they might be configurable to your proposed pseudo CSV. (Or even DSV. Or USV. Etc.) But I'd rather just not need to, and the sanest default for any CSV library is the standard format.
(Or even better … just emit newline-terminated JSON. Richer format, less craziness than CSV, parsers still abound.)
¹(RFC 4180. "," is field sep, CRLF is row sep. You can escape a comma or a CRLF by surrounding the entire field in double-quotes, and a double quote itself can be escaped by escaping the field, doubling the internal double quote.)