Skip to content

CsvParser doesn't handle whitespace outside of quoted values correctly #643

@cowtowncoder

Description

@cowtowncoder

(original issue: FasterXML/jackson-dataformat-csv#19 by @tomdz)

When parsing a CSV file like:

"foo", "bar", "baz"
"baz", "foo", "bar"

the CSV parser will get confused and give me back exactly two values:

foo

and

 bar, baz
baz, foo, bar

(note the leading space here).

According to RFC 4180, these spaces should be considered to be part of the value, e.g. it should return 'foo', ' bar',' baz', and 'baz', ' foo', ' bar'.
Alternatively - maybe via a feature - it could trim the whitespace outside of quoted strings, e.g. 'foo', 'bar','baz', and 'baz', 'foo', 'bar'.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions