擅长:python、mysql、java
<p>解决方案将取决于您要针对哪个精确的Python版本,但是如果2.7足够向后兼容,您可以</p>
<pre><code>from __future__ import unicode_literals
</code></pre>
<p>这在Python3(至少3.2+)中是不可操作的,并且可以实现Python2.7中的预期。在</p>
^{pr2}$
<p>请参见<a href="http://python-future.org/unicode_literals.html" rel="nofollow">http://python-future.org/unicode_literals.html</a>上的注意事项,它指出“未来”并不真正涵盖3.0-3.2。因此,这个特殊的东西似乎也像我在3.1中所期望的那样工作。在</p>