title: How can I convert iso-8859-1 to utf8 correctly?
body: <p>I need to write  a response stream to a file. The stream contains an encoded page (iso-8859-1).</p>
  
  <p>This is my code:</p>
  
  <pre><code>...
  
  using (TextWriter writer = new StreamWriter(tmpFilePath))
  {
    using (TextReader reader = new StreamReader(answer, Encoding.GetEncoding("ISO-8859-1")))
    {
  
      string line = "";
      while ((line = reader.ReadLine()) != null) 
      {
  
        // try to decode
        string decoded_line = decode(line);
  
        writer.WriteLine(decoded_line);
      }
  
    }
  
  }
  
  ...
  
  
  string decode(string message) 
  {
    string result = "";
  
    Encoding iso = Encoding.GetEncoding("iso-8859-1");
    Encoding utf8 = Encoding.UTF8;
  
    byte[] isoBytes = iso.GetBytes(message);
    byte[] utf8Bytes = Encoding.Convert(iso, utf8, isoBytes);
  
    result = utf8.GetString(utf8Bytes);
  
    return result;
  }
  </code></pre>
  
  <p>The problem is that decode() is not working</p>
  
  <p><img src="https://i.stack.imgur.com/xHCyU.png" alt="enter image description here"></p>
  
  <p>How can I convert iso-8859-1 to utf8 correctly?</p>
  
  <p>UPDATE</p>
  
  <p>I rely on fiddler to get the content-type:</p>
  
  <p><img src="https://i.stack.imgur.com/RwJve.png" alt="enter image description here"></p>