Open jasonchester opened 5 years ago
I believe this is the code that controls the observed behavior. After the parser reads the second quote, it continues to read the rest of the field like a normal (unquoted) field. I agree with @jasonchester that the desired behavior would be to see this as bad data if it is not hitting either a delimiter or an escape quote after reaching the second quote. https://github.com/JoshClose/CsvHelper/blob/2914f6856febbf7488c53ed65948a00a39f95a22/src/CsvHelper/CsvParser.cs#L695-L700 rfc4180 seems to indicate that you can't have a partially quoted field.
- Each field may or may not be enclosed in double quotes (however some programs, such as Microsoft Excel, do not use double quotes at all). If fields are not enclosed with double quotes, then double quotes may not appear inside the fields.
When parsing this misquoted record, BadDataFound is not being invoked.
The field with the issue is:
"RUSSELL "HILLS," "
data
Result
Expected Result This row should be flagged as Bad and I should be able to handle it using BadDataFound