3 ms·
Let me define a sane CSV standard: 1. Encoding is UTF-8. 2. Header line with column names is mandatory. If there are no column names, the first line must be b
by kazinator 5y ago
Let me define a sane CSV standard:
1. Encoding is UTF-8.
2. Header line with column names is mandatory. If there are no column names, the first line must be blank.
3. Each record is a line. A line is defined according to the operating platform's text file format.
4. In the light of (3) CSV does not dictate line endings and does not address the conversion issue of text files from one platform being transferred to another platform for processing. This consideration is a general text issue, off-topic to CSV.
5. CSV consists of items separated by quotes. An item may be:
5. a) a JSON number, surrounded by optional whitespace. Such an object may be specially recognized as a number by the CSV-processing implementation.
5. b) the symbol true, false or nil, optionally surrounded by whitespace. These symbols may have a distinct meaning from "true", "false" or "nil" strings in the CSV-processing implementation.
5. c) a JSON string literal
5. d) any sequence of printable and whitespace characters, other than comma or quote, including empty sequence.
6. In the case of (5) (d), the sequence is interpreted as a character string, after the removal of leading and trailing whitespace. (To preserve leading and trailing whitespace in a datum, a JSON literal must be used.)
7. In (5), whitespace refers to the ASCII space (32) and TAB (9) character. If there are any other control characters, the processing behavior is implementation-defined. Arbitrary character codes may be encoded using JSON literals.