Simply put, encoding is way your data is stored inside memory.The different ways, allow for more characters, and information. For an in-depth explanation you are more than welcome to read either http://kunststube.net/encoding/, or Wikipedia
In python you can change the way things are stored by either physically calling an encoding type, or with the use of any of the coding function.
For your environment of python3.x, there is no difference between sys.stdout.encoding
and sys.getdefaultencoding()
. They both use the 8-bite code units (most standard). While the preferred encoding,locale.getpreferredencoding()
(cp1252
), is the windows version of latin1
.
Note that if you would like to get quick feedback with any method/function, you can always use the help command.
Example:
>>> import locale
>>> help(locale.getpreferredencoding)
Output:
Help on function getpreferredencoding in module locale:
getpreferredencoding(do_setlocale=True)
Return the charset that the user is likely using,
according to the system configuration.
(END)