quote value ending with multi-character delimiter prefix#620
Open
rootvector2 wants to merge 1 commit into
Open
quote value ending with multi-character delimiter prefix#620rootvector2 wants to merge 1 commit into
rootvector2 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
printWithQuotesin MINIMAL quote mode does not encapsulate a value whose tail is a straddling prefix of a multi-character delimiter, so the printed record cannot be read back. With delimiter||, a field ending in|such asa|is written unquoted, and the recorda|||bis then parsed byCSVParseras[a, |b]because the greedy lexer matches the delimiter one character early at the value/delimiter boundary. The existing scan only quotes when the full delimiter occurs inside the value; a trailing partial delimiter slips through. Fixed byendsWithDelimiterPrefix, which quotes the value when appending the delimiter after it would create a boundary-straddling delimiter match. Single-character delimiters and values that contain the delimiter start without a straddling suffix (for example delimiter[|], valuea[) are unaffected.Found while auditing multi-character delimiter round-trips through the printer.
mvn; that'smvnon the command line by itself.