当在OSX上的Emacs下运行IPython作为一个低级进程时,我遇到了一个奇怪的错误,Unicode字符串没有被正确解释。你知道吗
Emacs下的IPython:
In [10]: print u"\u2713"
---------------------------------------------------------------------------
UnicodeEncodeError Traceback (most recent call last)
<ipython-input-10-60ae8ccda869> in <module>()
----> 1 print u"\u2713"
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2713' in position 0: ordinal not in range(128)
命令行上的IPython:
In [12]: print u"\u2713"
✓
我正在通过M-x run-python
开始我的进程。我的os.environ
在每个过程中都是不同的。我还看到控制台上的locale.getpreferredencoding
是"UTF-8"
,Emacs中的"US-ASCII"
。但是,我不知道如何解决这个问题。你知道吗
如何让Emacs中的IPython正确解释Unicode字符串?你知道吗
更新:我尝试按照建议通过python-mode.el
启动低级Python进程。同样的错误也会发生。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐