CSV.js icon indicating copy to clipboard operation
CSV.js copied to clipboard

4180 claim 6 failure: contained quotes and newlines

Open StoneCypher opened this issue 7 years ago • 0 comments

4180 says in section 2 claim 6 that if there's a quote or a newline in the value, the field needs to be quoted

   6.  Fields containing line breaks (CRLF), double quotes, and commas
       should be enclosed in double-quotes.  For example:

       "aaa","b CRLF
       bb","ccc" CRLF

Here are four failed cases: embedded \n, embedded \r, embedded \r\n, and embedded "

Johns-MacBook-Pro:scratch john$ node
> var csv = require('comma-separated-values');
undefined
> csv.encode([ [1,2,3,4], ["A\rB","C\nD","E\r\nF","G\"H"] ]);
'1,2,3,4\r\nA\rB,C\nD,E\r\nF,G"H'

StoneCypher avatar Nov 21 '17 17:11 StoneCypher