擅长:python、mysql、java
<p>显然,python从路径中的<code>LC_CTYPE</code>变量中获取<code>sys.stdout</code>的编码方案。在</p>
<pre><code>ayush:~$ export LC_CTYPE=POSIX python
ayush:~$ python
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:16:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stdout.encoding
'ANSI_X3.4-1968'
</code></pre>