Skip to content

More relaxed quote-char parsing with strict = false #37

@i0cus

Description

@i0cus

Hi David,

I've recently faced issues with Google Docs exported sheet, since (of course) it does not escape quotes. The issue happens if field starts with quoted value, but then continues unquoted. Minimal reproduction case would be:

Lewis;Huey;"Hip To Be Square" by Huey Lewis and the News

It chokes on the \space right after second quote. I'd expect it to thrown an exception with strict = true, but with strict = false I'd like it to recover into:

["Lewis", "Huey", "\"Hip To Be Square\" by Huey Lewis and the News"]

I did manage to prototype a fix within parse-csv-line to achieve this, it would however affect quoting related change done in 2.0.2 -- as it modifies default behavior (with strict = false). Strict mode still fails as expected. Related 2.0.2 quoting tests are currently a regression and would have to be moved to strictness tests section.

Would you be interested?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions