Skip to content

needsQuoting in DelimiterWriter.write is determined incorrectly #54

Description

@brentleeper

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions