¡@

Home 

python Programming Glossary: sys.stdout.encoding

Why does Python print unicode characters when the default encoding is ASCII?

http://stackoverflow.com/questions/2596714/why-does-python-print-unicode-characters-when-the-default-encoding-is-ascii

that string using the encoding scheme currently stored in sys.stdout.encoding. Python actually picks up this setting from the environment.. it picks up and use that setting python import sys print sys.stdout.encoding UTF 8 Let's for a moment exit the Python shell and set bash's.. to its default ascii encoding. python import sys print sys.stdout.encoding ANSI_X3.4 1968 Bingo If you now try to output some unicode character..