Unicode Encode Error in Sublime Text 3 console

2019-04-02 05:50发布

I’m always getting a

'UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 0: ordinal not in range(128)'

in the sublime text 3 console when trying to print a non-ascii character. I'm using Anaconda Python Builder to build the system. Building the system with the built-in “python” runs perfectly (i.e. prints out non-ascii characters fine) and also running the script from the terminal works fine (i'm running the script on Mac OS Sierra).

I assume the problem must have something to do with the Anaconda Python Builder and I thought adding the default encoding to the Anaconda.sublime-settings might help, but it doesn’t :-( Here is my anaconda user settings file:

{ "python_interpreter": "/usr/local/bin/python3.6", "anaconda_linting": false, "pep8": false, "default_encoding": "UTF-8" }

I would very much appreciate if you could help me along in this matter as I’m searching for a solution for two days now without success :-(

Thank you! Chris

1条回答
Summer. ? 凉城
2楼-- · 2019-04-02 06:24

Alright, I found a way to do it:

查看更多
登录 后发表回答