Csvhelper: Line breaks not according to ISO4180

Created on 5 Mar 2019  路  2Comments  路  Source: JoshClose/CsvHelper

According to ISO4180 (which CsvHelper states to be compliant to) it states the following about line breaks:

Each record is located on a separate line, delimited by a line
       break (CRLF).  For example:

       aaa,bbb,ccc CRLF
       zzz,yyy,xxx CRLF

CRLF translates to line endings as used in Windows (\r\n).
However I noticed that running on Linux the line breaks are LF (\r) instead.

Line breaks seem to be written by using WriteLine() of the internally used TextWriter which will write line endings based on the platform the code is executing on.

Shouldn't CsvHelper always write a hardcoded \r\n instead of using TextWriter.WriteLine()?

Most helpful comment

Thanks! Can you release a new version on NuGet?

All 2 comments

Yes. I think that would be ok. It will read \r\n (windows), \r (mac), and \n. It should by default write the ISO standard format.

Thanks! Can you release a new version on NuGet?

Was this page helpful?
0 / 5 - 0 ratings