News for hackers. Stuff that matters.
Re:A love letter to the CSV format by dietr1ch on Thursday March 27, 2025 @01:17PM (#43495720)
> Exactly. "Use a delimiter that's not in the data" is not real serialisation, it's fingers-crossed-hope-for-the-best stuff.

It's not doing just this, you pick something that's likely not in the data, and then escape things properly. When writing strings you can write a double quote within double quotes with \", and if you mean to type the designated escape character you just write it twice, \\.

The only reason you go for something likely not in the data is to keep things short and readable, but it's not impossible to deal with.

Re:A love letter to the CSV format by mjw_byrne on Friday March 28, 2025 @07:57AM (#43504257)
I agree that it's best to pick "unlikely" delimiters so that you don't have to pepper your data with escape chars.

But some people (plenty in this thread) really do think "pick a delimiter that won't be in the data" - and then forget quoting and/or escaping - is a viable solution.