Skip to content

[CSV-326] Escape Reader values with quote and escape#606

Open
OldTruckDriver wants to merge 1 commit into
apache:masterfrom
OldTruckDriver:fix/csvprinter-reader-quote-escape
Open

[CSV-326] Escape Reader values with quote and escape#606
OldTruckDriver wants to merge 1 commit into
apache:masterfrom
OldTruckDriver:fix/csvprinter-reader-quote-escape

Conversation

@OldTruckDriver

Copy link
Copy Markdown

Fixes CSV-326.

CSVFormat#printWithQuotes(Reader, Appendable) escaped embedded quote characters but did not escape a configured escape character. When a Reader value contained an escape character immediately before a quote, CSVPrinter could emit CSV that the same format could not parse back.

This updates the Reader quoted printing path to escape both quote and escape characters, matching the CharSequence printing path's round-trip behavior.

Added a regression test for Reader printing with an escape character before a quote.

Tests:

  • mvn -q test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant