title: UTF-8 Encoding in python gets transformed to ASCII?
body: <p>I'm attempting to do something very simple, which is read a file in ascii or utf-8-sig and save it as utf-8. However, when I run the function below, and then do <code>file filename.json</code> in linux, it always shows the file as being ASCII. I have tried using codecs, and no luck either. The only way I can get it to work, is if I replace <code>utf-8</code> with <code>utf-8-sig</code>, BUT that gives me the issue that the file has BOM endings. I've searched around for solutions, and I found some removing the beginning characters, however,  after this is performed, the file becomes ascii again. I have tried everything her: <a href="https://stackoverflow.com/questions/8898294/convert-utf-8-with-bom-to-utf-8-with-no-bom-in-python">Convert UTF-8 with BOM to UTF-8 with no BOM in Python</a></p>
  <pre><code>def file_converter(file_path):
      s = open(file_path, mode='r', encoding='ascii').read()
      open(file_path, mode='w', encoding='utf-8').write(s)
  </code></pre>