3 ms·
> The default encoding in Python 3 is utf-8, instead of the insane ascii default in Python 2. It is only a default encoding for Python source code. Library and
by kmike84 12y ago
> The default encoding in Python 3 is utf-8, instead of the insane ascii default in Python 2.
It is only a default encoding for Python source code. Library and builtin functions can still use another defaults. For example, builtin "open" uses "locale.getpreferredencoding".
- ak217 12y agoYes, thanks. I should have been clearer: the point is that Python 3 obeys the I/O encoding specified by the system locale (which on modern systems is utf-8), whereas Python 2 disobeys it and uses ascii by default instead.