0

I'm trying to read strings from a .csv file through the FileHelperEngine library in this way:

        UTF8Encoding utf8 = new UTF8Encoding();
        var engine = new FileHelperEngine(typeof(TipologieMetadatiCsv), utf8);

and I've issues with accented chars, like:

Sofà -> "Sof�"

How this could be solved ?

andreasperelli
  • 1,034
  • 2
  • 11
  • 40

1 Answers1

1

Solved in this way:

        TextReader textReader = new StreamReader(stream, Encoding.GetEncoding("iso-8859-1"));

        var engine = new FileHelperEngine(typeof(TipologieMetadatiCsv), Encoding.GetEncoding("iso-8859-1"));
andreasperelli
  • 1,034
  • 2
  • 11
  • 40
  • 1
    Probably the file isn't in iso-8859-1 but is in windows-1252. There are little differences, like the support for the '€' symbol, and in general the windows-1252 is a superset of the iso-8859-1 – xanatos Jan 28 '21 at 10:32
  • so you suggest to use windows-1252 ? – andreasperelli Jan 28 '21 at 10:32