title: Define source code encoding on command line, not in source code
body: <p>I want to contribute to an open source python library which is on 2.7. (<a href="https://github.com/plexinc-plugins" rel="nofollow noreferrer">https://github.com/plexinc-plugins</a>) Its source code files do <em>not</em> have this <code>coding: utf-8</code> header comment that everywhere is mentioned and apparently was set in <a href="https://www.python.org/dev/peps/pep-0263/" rel="nofollow noreferrer">PEP 263</a>. However, I still get an <code>SyntaxError: Non-ASCII character '\xc3' in file […] but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details</code> when I try to <code>$ python</code> them on the command line.</p>
  <p>(How) can I set on interpreter level, i.e. with the <code>python</code> command, that the whole code base is UTF-8?</p>
  <p>What I tried:</p>
  <ul>
  <li>I've seen environment variables (<code>PYTHONUTF8=1</code> or <code>PYTHONIOENCODING</code>) that are supposed to do the trick but they don't work, i.e. error stays the same. (aha: seems to be &gt;=3.7, so nevermind)</li>
  <li>A command-line argument <code>-X utf8</code> says <code>-X is reserved for implementation-specific arguments</code>. (dito 3.7)</li>
  <li>There's also stuff going on with a <code>sitecustomize.py</code> but I don't know what it is. Is it a bootstrap file that is loaded prior to everything else? At least I wasn't able to find it.</li>
  </ul>