You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2021/06/08 07:36:31 UTC

[incubator-streampipes-extensions] 01/01: Change encoding for configuration csv file

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-379
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git

commit e2a7e6e0c9796871403180c725fb4509d9b11503
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Jun 8 09:35:39 2021 +0200

    Change encoding for configuration csv file
---
 .../apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
index a8dcbbd..25207d1 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/plc4x/s7/Plc4xS7Adapter.java
@@ -56,6 +56,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -297,7 +298,8 @@ public class Plc4xS7Adapter extends PullAdapter {
         if (selectedAlternative.equals(CSV_IMPORT)) {
             // CSV file
             try {
-                String csvFileContent = extractor.fileContentsAsString(PLC_NODES_CSV_FILE);
+                byte[] csvFileContentByte = extractor.fileContentsAsByteArray(PLC_NODES_CSV_FILE);
+                String csvFileContent = new String(csvFileContentByte, StandardCharsets.UTF_8);
                 List<S7ConfigFile> configFiles = this.getCsvConfig(csvFileContent);
                 this.nodes = makeConfigMap(configFiles);
             } catch (IOException e) {