I have this code :
string ABSfilePath = "";
CsvFileReader reader = null;
ABSfilePath = Server.MapPath("/myfile.csv");
try
{
reader = new CsvFileReader(ABSfilePath);
CsvRow myRow = new CsvRow();
while (reader.ReadRow(myRow))
{
Response.Write(myRow[0].ToString()+"<br />");
}
}
catch (Exception err)
{
Response.Write(err.Message);
}
finally
{
if (reader != null)
reader.Dispose();
}
but when I try to import my file myfile.csv, some chars are “uncorrectly” encoded, like :
STATUA DELLA LIBERT�
So, how can encode this? Thanks
is the culprit. You should first open a StreamReader with the correct encoding (I suspect UTF-8),
then do