JoshClose / CsvHelper

Library to help reading and writing CSV files
http://joshclose.github.io/CsvHelper/
Other
4.72k stars 1.06k forks source link

CsvParser failes to parse quoted fields when they contain CarriageReturn ( \r ) without LineFeed ( \n ) #645

Closed rknoll closed 7 years ago

rknoll commented 7 years ago

See this example: new CsvParser(new StringReader("\"a\r\";b")).Read() This should return 2 values, the first containing a\r, the second b, but it will contain a\r";b, as it failes to detect the second quote.

I think this issue is caused by not checking the return value of ReadLineEnding() in CsvParser, resulting in a skipped character, which in this case is the second quote.

mnye commented 7 years ago

Hey, I attempted to fix this in the PR #650 . Hope it helps!

JoshClose commented 7 years ago

Merged the PR.