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

needsQuoting in DelimiterWriter.write is determined incorrectly #54

Open
brentleeper opened this issue Mar 24, 2020 · 3 comments
Open

Comments

@brentleeper
Copy link

Currently:

final boolean needsQuoting = stringValue.indexOf(delimiter) != -1 //
|| foundQualifier //
|| stringValue.indexOf('\n') != -1;

Should be:

final boolean needsQuoting = foundQualifier && (stringValue.indexOf(delimiter) != 1 || stringValue.indexOf("\n") != 1);

Because:

If the qualifier is not found, then you cannot write the qualifier ever.

@brentleeper
Copy link
Author

Currently, even if I set the qualifier in the DelimiterWriterFactory to FPConstants.NO_QUALIFIER, there is still a case where the qualifier will be written. This is incorrect.

@benoitx
Copy link
Contributor

benoitx commented Mar 24, 2020 via email

@brentleeper
Copy link
Author

First can you help me to understand the purpose of foundQualifier, just to make sure I am understanding correctly

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

No branches or pull requests

2 participants