Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-char delimiter incorrectly detected inside quoted string #404

Closed
adutra opened this issue Jul 11, 2020 · 1 comment
Closed

Multi-char delimiter incorrectly detected inside quoted string #404

adutra opened this issue Jul 11, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@adutra
Copy link

adutra commented Jul 11, 2020

I've been playing with multi-char delimiters (thanks for the feature!!) and came across a weird corner-case:

CsvFormat format = new CsvFormat();
format.setDelimiter("||");
CsvParserSettings settings = new CsvParserSettings();
settings.setFormat(format);
CsvParser parser = new CsvParser(settings);
List<Record> lines = parser.parseAllRecords(new StringReader("foo||bar||\"||\"||\"foo||bar\""));
System.out.println(lines);

I would expect the above to print:

[foo, bar, ||, foo||bar]

But it actually prints:

[foo, bar, null, null, foo||bar]

I guess there is some ambiguity as to how to interpret \"||\".

@jbax jbax self-assigned this Jul 22, 2020
@jbax jbax added the bug label Jul 22, 2020
@jbax jbax added this to the 2.8.5 milestone Jul 22, 2020
jbax added a commit that referenced this issue Jul 22, 2020
@jbax
Copy link
Member

jbax commented Jul 22, 2020

Thanks for reporting this one. I've fixed it and released version 2.8.5-SNAPSHOT if you want to test it to check.

@jbax jbax closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants