nortal / Utilities.Csv

Library to read and write CSV format according to RFC4180.
Apache License 2.0
7 stars 3 forks source link

Parser: Escaped quote in unquoted value must throw. #6

Open ImrePyhvel opened 7 years ago

ImrePyhvel commented 7 years ago
  1. 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.

Repro steps: add 2 consecutive quotes within a value during parsing (Ex: my""value) Current behavior: current parser (0.9.2) considers it an escaped quoting char (Ex: my"value) Expected behavior: By RFC it must be invalid input instead. Exceptions should be thrown stating invalid input.

While current implementation can successfully parse wider range of documents, it is in conflict with RFC4180. As compliance is a main goal for the project then it can be considered a bug.

Added test TestUnquotedValueContaining2QuotesThrows to repro the issue.