Why does Python default to ASCII encoding?
<p>I've run into lots of bugs in Python due to the default ASCII encoding. I always have to remember to switch it to utf8</p>

<p>I wanted to know, is there any reason or benefit to a default ASCII encoding? It seems strictly worse than utf8, and causes annoying bugs. Am I missing something by always switching to utf8?</p>

<p>Because Python 2 Unicode was built (back in 1999-2000) before UTF-8 was ubiquitous. ASCII on the other hand was understood by almost all target platforms using 8-bit codecs.</p>

<p>If you look at the <a href="https://en.wikipedia.org/wiki/UTF-8" rel="nofollow">Wikipedia UTF-8 adoption graph</a>, you'll see that UTF-8 didn't really rise to popularity until 2006:</p>

<p><a href="http://i.stack.imgur.com/aZCCq.png" rel="nofollow"><img src="http://i.stack.imgur.com/aZCCq.png" alt="UTF-8 growth graph from Wikipedia"></a></p>

<p>Only with Python 3 was it possible to change this default; there implicit encoding and decoding is gone, and the default source code encoding has been changed to UTF-8 (the default for printing, file I/O and filesystem names is system dependent, as it is in Python 2).</p>

python utf-8 character-encoding ascii