News for hackers. Stuff that matters.
Re:A love letter to the CSV format by zzo38computer on Wednesday March 26, 2025 @05:31PM (#43487578)
One benefit of binary formats is not needing the escaping.
Re:A love letter to the CSV format by LegionMammal978 on Wednesday March 26, 2025 @08:48PM (#43489241)
Length-delimited binary formats do not need escaping. But the usual "ASCII Delimited Text" proposal just uses two unprintable bytes as record and line separators, and the signalling is all in-band.

This means that records must not contain either of those two bytes, or else the format of the table will be corrupted. And unless you're producing the data yourself, this means you have to sanitize the data before adding it, and have a policy for how to respond to invalid data. But maintaining a proper sanitization layer has historically been finicky: just look at all the XSS vulnerabilities out there.

If you're creating a binary format, you can easily design it to hold arbitrary data without escaping. But just taking a text format and swapping out the delimiters does not achieve this goal.

Re:A love letter to the CSV format by immibis on Thursday March 27, 2025 @06:53AM (#43492223)
At least you don't need these values in your data, unlike the comma, which shows up in human-written text.

If you do need these values in your data, then don't use them as delimiters.

Something the industry has stopped doing, but maybe should do again, is restricting characters that can appear in data. "The first name must not contain a record separator" is a quite reasonable restriction. Even Elon Musk's next kid won't be able to violate that restriction.

Re:A love letter to the CSV format by zzo38computer on Thursday March 27, 2025 @11:51AM (#43494909)
I did mean length-delimited binary formats (rather than ASCII formats).
Re:A love letter to the CSV format by oever on Thursday March 27, 2025 @06:39AM (#43492150)
Hear hear! Why is all editing done with text-based editors where humans can make syntax errors. Is it about job security?