import java.io.IOException;
import java.io.Reader;
+import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
public static Map<String, Integer> readCSVHeader(Path source, CSVFormat format, boolean firstAsHeader) throws IOException {
if (firstAsHeader)
format = format.withFirstRecordAsHeader();
- try (CSVParser parser = format.parse(Files.newBufferedReader(source))) {
+ try (CSVParser parser = format.parse(Files.newBufferedReader(source, Charset.defaultCharset()))) {
return parser.getHeaderMap();
}
}
public void setTechTypePath(String path) {
String data;
try {
- data = Files.lines(Paths.get(path)).collect(Collectors.joining("\n"));
+ data = Files.lines(Paths.get(path), Charset.defaultCharset()).collect(Collectors.joining("\n"));
} catch (IOException e) {
LOGGER.error("Failed to read contents of file '{}' as {}", path, Charset.defaultCharset(), e);
return;