From c410e7de746abfbb64f8db7f1ebf558fd61f1dd4 Mon Sep 17 00:00:00 2001 From: Maxim Gorbunkov Date: Mon, 25 Oct 2021 13:47:26 +0400 Subject: [PATCH] Update opencsv version to 5.5.2 #159 --- core/build.gradle | 2 +- .../src/com/haulmont/yarg/formatters/impl/CsvFormatter.java | 3 ++- .../src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 9164e987..1db6494f 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -264,7 +264,7 @@ configure(core) { } compile(group: "org.jsoup", name: "jsoup", version: "1.12.1") compile(group: "com.jayway.jsonpath", name: "json-path", version: "2.4.0") - compile(group: "com.opencsv", name: "opencsv", version: "4.6") + compile(group: "com.opencsv", name: "opencsv", version: "5.5.2") compile group: 'org.olap4j', name: 'olap4j', version: '1.2.0' compile(group: "net.sf.jasperreports", name: "jasperreports", version: "6.9.0") { exclude(group: 'org.apache.lucene') diff --git a/core/modules/core/src/com/haulmont/yarg/formatters/impl/CsvFormatter.java b/core/modules/core/src/com/haulmont/yarg/formatters/impl/CsvFormatter.java index 1d867957..a8ac72af 100644 --- a/core/modules/core/src/com/haulmont/yarg/formatters/impl/CsvFormatter.java +++ b/core/modules/core/src/com/haulmont/yarg/formatters/impl/CsvFormatter.java @@ -54,7 +54,8 @@ public void renderDocument() { protected void writeCsvDocument(BandData rootBand, OutputStream outputStream) { try { List actualData = getActualData(rootBand); - CSVWriter writer = new CSVWriter(new OutputStreamWriter(outputStream), separator, CSVWriter.DEFAULT_QUOTE_CHARACTER); + CSVWriter writer = new CSVWriter(new OutputStreamWriter(outputStream), separator, + CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER, CSVWriter.DEFAULT_LINE_END); writer.writeNext(header); diff --git a/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java b/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java index 74fcd7dd..b21ff5f5 100644 --- a/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java +++ b/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java @@ -1026,7 +1026,8 @@ protected T getLast(List list) { } protected void saveXlsxAsCsv(Document document, OutputStream outputStream) throws IOException, Docx4JException { - CSVWriter writer = new CSVWriter(new OutputStreamWriter(outputStream), ';', CSVWriter.DEFAULT_QUOTE_CHARACTER); + CSVWriter writer = new CSVWriter(new OutputStreamWriter(outputStream), ';', CSVWriter.DEFAULT_QUOTE_CHARACTER, + CSVWriter.DEFAULT_ESCAPE_CHARACTER, CSVWriter.DEFAULT_LINE_END); for (Document.SheetWrapper sheetWrapper : document.getWorksheets()) { Worksheet worksheet = sheetWrapper.getWorksheet().getContents();