4 ms·
I expect what the parent is truly imagining (but hasn't really thought through the usability implications of) is a format where ASCII newline + ASCII comma are
by derefr 10y ago
I expect what the parent is truly imagining (but hasn't really thought through the usability implications of) is a format where ASCII newline + ASCII comma are used as delimiters, and then everything else is encoded further so as to basically become opaque octet-strings (whose encoding is such that it will never include '\n' or ',').
In other words, if you take CSV and make it completely useless for hand-editing in a text-editor by taking it 90% of the way to being a length-prefixed binary encoding, you'll have what the programmer's mind intuitively jumps to as "what CSV should be."
- supergreg 10y agoWhy not just use ASCII 31/30 instead of comma/new line. Just give it a new name like ASV (ASCII separated values). What would take to give glyphs to those characters? Just add them to some font?
- asdkljasdka 10y agoNo, what OP is talking about is the fact that Excel formats and parses CSV files differently depending on locale settings. For example, here in mainland Europe, Excel thinks CSV files should look like this: ColA;ColB;ColC 1,618;2,718;3,14159 And in fact, to open an "American" CSV file in Excel you either have to set Windows to American locale settings, or use the text import wizard or the "text to columns" feature. If you don't use the correct settings, Excel will not complain, but corrupt the data (sometimes subtly). I hope you agree that it is INSANE to make a file format depend on locale settings. As someone who writes software for scientists in Europe it leads to endless confusion and annoyance. (And even if you do everything correctly, Excel will still mangle certain CSV files, interpreting phone numbers as dates etc...)
- epmatsw 10y agoWe got a bug report of this exact issue yesterday, and it literally stunned me. Who on earth thought that was a good idea?
- taneq 10y agoOh wow, insane is the right word for that. (Once long ago in my youth, I got bitten when the quoting app I was writing worked fine on our test server, but got the day and month fields swapped on our customer's server. And that was when I learned that you shouldn't pass dates through ODBC as text strings... SQL Server was parsing dates based on the Windows date settings. Our test server was set to the default U.S. date format but the customer's server was set to DD/MM/YY, or vice versa, I can't remember now. What made it worse was that we handed the system over early in a month, and it worked fine for over a week...)
- dmichulke 10y agoAn alternative would have been to not label it "CSV", Another one would have been to write numbers in a CSV file in the American format and just adapt them to the current locale when reading them. Both would be a more sensible interpretation of your GP.
- mSparks 10y agoNo more sensible than starting with Japansese format and force the Americans to adapt to their locale when reading them.... That'll make the world a better place wouldn't it?.....
- userbinator 10y agoActually newlines and commas are OK, and in fact arbitrary bytes can be put into CSV, because officially[1] CSV supports escaping using quotes (and escaping quotes by doubling them). [1] https://www.ietf.org/rfc/rfc4180.txt https://www.ietf.org/rfc/rfc4180.txt