I'm using open csv parser.My csv file contains a special character like this "‼".
I read this character frm a csv file and read it into another csv file using java.
When I open the output csv file it contains ? instead of the character ‼
I specified UTF-8 as an argument when reading and writing the file.
Here is my code:
Map<String, String> feedValues = new LinkedHashMap<String, String>();
CSVReader csvReader = new CSVReader(new InputStreamReader(
new FileInputStream(csvFilename)));
List content = csvReader.readAll();
CSVWriter writer = new CSVWriter(..);
List<String[]> data = new ArrayList<String[]>();
for (Object object : content) {
row = (String[]) object;
for (int i = 0; i < row.length; i++) {
row[i] = StringEscapeUtils.escapeHtml(row[i]);
row[i] = row[i].replace("\n", " ");
}
data.add(row);
}
writer.writeAll(data);