I have a csv file. i need to display csv file content in html table using jsp. i had written a desired code using open csv. yes, it is sucessfully shown in html table. But some cryptic characters are displayd like " -?- 1 -?-
" in the place of "- 1-
" where those question marks are unecessary.
I had tried converting values to ansi in the following way to eliminate entry of cryptic characters :
csvReader = new CSVReader(reader);
int rowCount = 1;
while ((line = csvReader.readNext()) != null) {
%>
<tr>
<td class="heading" width="30"><%=rowCount%></td>
<%
for (int i = 0; i < line.length; i++) {
if (rowCount == 1) {
%>
<td class="ex-headding" width="120"><strong><%=line[i]%></strong></td>
<%
} else {
//this is the code to convert into ansi
String utf = line[i];
byte[] data = utf.getBytes("ASCII");
line[i] = new String(data);
%>
<td><%=line[i]%></td>
<%
}
}
%>
But issue still there . Is that the correct way of conversion into ANSI