title: Writing to a .txt file (UTF-8), python
body: <p>I want to save the output (<code>contents</code>) to a file (saving it in UTF-8). The file shouldn't be overwritten, it should be saved as a new file - e.g. <code>file2.txt</code> 
  So, I fists open a <code>file.txt</code>, encode it in UTF-8, do some stuff and then wanna save it to <code>file2.txt</code> in UTF-8. How do I do this?</p>
  
  <pre><code>import codecs
  def openfile(filename):
      with codecs.open(filename, encoding="UTF-8") as F:
          contents = F.read()
          ...
  </code></pre>