diff --git a/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVReader.java b/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVReader.java index 1a448f162..541e21312 100644 --- a/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVReader.java +++ b/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVReader.java @@ -161,8 +161,8 @@ private String parseQuotedField(final CharacterReader rd) { } } else { - rd.consume(); sb.append((char)ch); + rd.consume(); } } diff --git a/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVWriter.java b/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVWriter.java index 031776af6..625801300 100644 --- a/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVWriter.java +++ b/src/main/java/com/github/jlangch/venice/impl/util/csv/CSVWriter.java @@ -147,10 +147,10 @@ private String escape(final String s) { } private String quote(final String s) { - return needsQuote(s) ? quote + escape(s) + quote : s; + return needsQuoting(s) ? quote + escape(s) + quote : s; } - private boolean needsQuote(final String s) { + private boolean needsQuoting(final String s) { return s != null && (s.contains(" ") || s.contains(quote) || s.contains(separator)