0
我現在遇到ubuntu下和Python 3.4Ubuntu的python3 UnicodeEncodeError
只有一個打印與兩家中國的unicode charaters下面的錯誤。
[email protected]:~# python3 a.py
Traceback (most recent call last):
File "a.py", line 1, in <module>
print('\u4f60\u597d')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
我可以通過vim編輯漢字。
我試着檢查python3編碼:
>>> import sys
>>> print(sys.getdefaultencoding())
utf-8
它似乎確定。
怎麼回事?請幫忙。
適合我。標準輸出的編碼是什麼?你的場所是什麼? – tripleee