title: Replacing characters in C# (ascii)
body: <p>I got a file with characters like these: à, è, ì, ò, ù - À. What i need to do is replace those characters with normal characters eg: à = a, è = e and so on..... This is my code so far:</p>
  
  <pre><code>StreamWriter sw = new StreamWriter(@"C:/JoinerOutput.csv");
  string path = @"C:/Joiner.csv";
  string line = File.ReadAllText(path);
  
  if (line.Contains("à"))
  {
      string asAscii = Encoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding(Encoding.ASCII.EncodingName, new EncoderReplacementFallback("a"), new DecoderExceptionFallback()), Encoding.UTF8.GetBytes(line)));
      Console.WriteLine(asAscii);
      Console.ReadLine();
  
      sw.WriteLine(asAscii);
      sw.Flush();
  }
  </code></pre>
  
  <p>Basically this searches the file for a specific character and replaces it with another. The problem that i am having is that my if statement doesn't work. How do i go about solving this? </p>
  
  <p>This is a sample of the input file:</p>
  
  <pre>
  Dimàkàtso Mokgàlo
  Màmà Ràtlàdi
  Koos Nèl
  Pàsèkà Modisè
  Jèrèmiàh Morèmi
  Khèthiwè Buthèlèzi
  Tiànà Pillày
  Viviàn Màswàngànyè
  Thirèshàn Rèddy
  Wàdè Cornèlius
  ènos Nètshimbupfè
  </pre>
  
  <p>This is the output if use : line = line.Replace('à', 'a');  :</p>
  
  <pre>
  Chï¿½rlï¿½nï¿½ Kirstï¿½n
  Mï¿½mï¿½ Rï¿½tlï¿½di
  Koos Nï¿½l
  Pï¿½sï¿½kï¿½ Modisï¿½
  Jï¿½rï¿½miï¿½h Morï¿½mi
  Khï¿½thiwï¿½ Buthï¿½lï¿½zi
  Tiï¿½nï¿½ Pillï¿½y
  Viviï¿½n Mï¿½swï¿½ngï¿½nyï¿½
  Thirï¿½shï¿½n Rï¿½ddy
  Wï¿½dï¿½ Cornï¿½lius
  ï¿½nos Nï¿½tshimbupfï¿½
  </pre>
  
  <p>With my code the symbol will be removed completely</p>