Skip to content

Commit 281484f

Browse files
committed
Reads file as UTF-8 instead of system default charset.
1 parent 845c8e7 commit 281484f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/sparkpost-samples-app/src/main/java/com/sparkpost/samples/MandrillBlacklistImport.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
package com.sparkpost.samples;
33

44
import java.io.BufferedReader;
5-
import java.io.FileReader;
5+
import java.io.FileInputStream;
66
import java.io.IOException;
7+
import java.io.InputStreamReader;
78
import java.util.ArrayList;
89

910
import org.apache.commons.lang3.StringUtils;
@@ -68,7 +69,8 @@ private void runApp() throws SparkPostException, IOException {
6869

6970
int row = 0;
7071
try {
71-
br = new BufferedReader(new FileReader(csvFile));
72+
br = new BufferedReader(new InputStreamReader(new FileInputStream(csvFile), "UTF-8"));
73+
7274
while ((line = br.readLine()) != null) {
7375
row++;
7476
if (StringUtils.isEmpty(line)) {

0 commit comments

Comments
 (0)