title: Wrong encoding at converting a .csv file into a XDocument
body: <p>I need your help again please. I convert a .csv file into a XDocument with the following method:</p>
  
  <pre><code>    public static XDocument ConvertCsvToXml(string sourcePath)
      {
          string[] lines;
  
          try
          {
              lines = File.ReadAllLines(sourcePath);
          }
          catch (Exception e)
          {
              System.Diagnostics.Debug.WriteLine(e.Message);
              return null;
          }
  
          var headers = lines[0].Split(';').Select(x =&gt; x.Trim('\"')).ToArray();
  
          var xml = new XElement("FullInvoice", lines.Where((line, index) =&gt; index &gt; 0)
             .Select(line =&gt; new XElement("Line", line.Split(';')
             .Select((column, index) =&gt; new XElement(headers[index], column)))));
  
          return new XDocument(xml);
      }
  </code></pre>
  
  <p>This works well for me, but I have some troubles with the encoding, because some characters (e.g. 'ä', 'ö', 'ü', 'ß') and their upper variants are not correctly in the XDocument..</p>
  
  <p>Could you kindly advise me, where I have to set the encoding here to get this characters correct into my XDocument?</p>
  
  <p>Thank you in advance and best regards from austria!</p>