diff --git a/csv-core/src/reader.rs b/csv-core/src/reader.rs index dbd6dc3d..a3e2f079 100644 --- a/csv-core/src/reader.rs +++ b/csv-core/src/reader.rs @@ -1014,7 +1014,9 @@ impl Reader { EndFieldDelim => (StartField, NfaInputAction::Epsilon), EndFieldTerm => (InRecordTerm, NfaInputAction::Epsilon), InField => { - if self.delimiter == c { + if self.escape == Some(c) { + (InQuotedField, NfaInputAction::Discard) + } else if self.delimiter == c { (EndFieldDelim, NfaInputAction::Discard) } else if self.term.equals(c) { (EndFieldTerm, NfaInputAction::Epsilon) @@ -1023,7 +1025,9 @@ impl Reader { } } InQuotedField => { - if self.quoting && self.quote == c { + if self.delimiter == c { + (InField, NfaInputAction::CopyToOutput) + } else if self.quoting && self.quote == c { (InDoubleEscapedQuote, NfaInputAction::Discard) } else if self.quoting && self.escape == Some(c) { (InEscapedQuote, NfaInputAction::Discard)