Q:

Handle — while import csv file using C#

I had written code (in C#) about to import csv file using filehelper.
I am facing one issue that if file contain any &mdash (—) than it would replace by ? character (not exact ? instead some special character as per shown in below image)

How can i handle this by code?
Thanks.

A:

How your stream reader object is created ? Have you provided any specific encoding to it ? I think you should try if not yet, as default encoding can not be detected while there is no BOM defined.
From MSDN

The character encoding is set by the encoding parameter, and the
  buffer size is set to 1024 bytes. The StreamReader object attempts to
  detect the encoding by looking at the first three bytes of the stream.
  It automatically recognizes UTF-8, little-endian Unicode, and
  big-endian Unicode text if the file starts with the appropriate byte
  order marks. Otherwise, the user-provided encoding is used. See the
  Encoding.GetPreamble method for more information.

