Open brentleeper opened 4 years ago
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.
Hi
May I ask you to provide a unit test for this and I will fix the issue.
Thanks a lot, that would be great.
Benoit
On Tue, 24 Mar 2020 at 17:32, brentleeper notifications@github.com wrote:
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.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Appendium/flatpack/issues/54#issuecomment-603393116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB542KIWNILJKHAPXAGG5TRJDVDXANCNFSM4LS3IEZA .
First can you help me to understand the purpose of foundQualifier, just to make sure I am understanding correctly
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.