yaslab / CSV.swift

CSV reading and writing library written in Swift.
MIT License
661 stars 78 forks source link

Newlines are handled incorrectly when there's an escaped quote #123

Open drallgood opened 1 year ago

drallgood commented 1 year ago

Ran into this issue when parsing a CSV file that contained JSON-like data with newlines. Example:

"{(
    2fa,
    \"Apple Watch\"
)}","Another column","A third column"

From what it looks like, it gets split it into 3 rows.

If you, however, replace the double quotes with single quotes, it works just fine:

"Tags","Type","third"
"{(
    2fa,
    \'Apple Watch\'
)}","Another column","A third column"

I know, it's a very specific edge case, but I just wanted to let you know