title: Ansi to UTF-8 using python causing error
body: <p>While I was trying to write a python program that converts Ansi to UTF-8, I found this</p>
  
  <p><a href="https://stackoverflow.com/questions/14732996/how-can-i-convert-utf-8-to-ansi-in-python">https://stackoverflow.com/questions/14732996/how-can-i-convert-utf-8-to-ansi-in-python</a></p>
  
  <p>which converts UTF-8 to Ansi. </p>
  
  <p>I thought it will just work by reversing the order. So I coded</p>
  
  <pre><code>file_path_ansi = "input.txt"
  file_path_utf8 = "output.txt"
  
  #open and encode the original content
  file_source = open(file_path_ansi, mode='r', encoding='latin-1', errors='ignore')
  file_content = file_source.read()
  file_source.close
  
  #write 
  file_target = open(file_path_utf8, mode='w', encoding='utf-8')
  file_target.write(file_content)
  file_target.close
  </code></pre>
  
  <p>But it causes error.</p>
  
  <pre><code>TypeError: file&lt;&gt; takes at most 3 arguments &lt;4 given&gt;
  </code></pre>
  
  <p>So I changed </p>
  
  <pre><code>file_source = open(file_path_ansi, mode='r', encoding='latin-1', errors='ignore')
  </code></pre>
  
  <p>to </p>
  
  <pre><code>file_source = open(file_path_ansi, mode='r', encoding='latin-1')
  </code></pre>
  
  <p>Then it causes another error:</p>
  
  <pre><code>TypeError: 'encoding' is an invalid keyword arguemtn for this function
  </code></pre>
  
  <p>How should I fix my code to solve this problem?</p>