title: Converting Unicode to Windows-1252 for vCards
body: <p>I am trying to write a program in <strong>C#</strong> that will split a vCard (VCF) file with multiple contacts into individual files for each contact. I understand that the vCard needs to be saved as ANSI (1252) for most mobile phones to read them.</p>
  
  <p>However, if I open a VCF file using <code>StreamReader</code> and then write it back with <code>StreamWriter</code> (setting 1252 as the Encoding format), all special characters like <code>å</code>, <code>æ</code> and <code>ø</code> are getting written as <code>?</code>. Surely ANSI (1252) would support these characters. How do I fix this?</p>
  
  <p><strong>Edit:</strong> Here's the piece of code I use to read and write the file.</p>
  
  <pre><code>private void ReadFile()
  {
     StreamReader sreader = new StreamReader(sourceVCFFile);
     string fullFileContents = sreader.ReadToEnd();
  }
  
  private void WriteFile()
  {
     StreamWriter swriter = new StreamWriter(sourceVCFFile, false, Encoding.GetEncoding(1252));
     swriter.Write(fullFileContents);
  }
  </code></pre>