title: Python required utf-16 encoding on simple file
body: <p>I resolved this problem, but I'd like to understand the why.</p>
  <p>I am on a Windows 10 pc running Python 3.9.6.  I had a simple text file with a single line in it, which was just:</p>
  <blockquote>
  <p>Fifty_50</p>
  </blockquote>
  <p>I had been running a small python utility file for some time opening files like this and parsing through the contents without any issue, but I had been using Python 3.7.  My code was very simple:</p>
  <pre><code>with open(companyfile) as companies:
      for company in companies:
      ...
  </code></pre>
  <p>When I ran this yesterday, I started getting garbage instead of the text out of this simple one line file.  I decided it was likely because I wasn't providing encoding and changed the code to:</p>
  <pre><code>with open(companyfile, 'r', encoding='utf-8') as companies:
  </code></pre>
  <p>That gave me this error:</p>
  <blockquote>
  <p>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte</p>
  </blockquote>
  <p>Finally, I tried utf-16, and the file opened and processed normally.</p>
  <p>So my question is do I have to always specify utf-16 now that I'm using Python 3.9?  There were no special characters in the simple file that I was trying to open; so I don't understand why it had a problem.</p>
  <p>Any insight would be appreciated.</p>
  <p>Thanks--</p>
  <p>Al</p>