Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python]UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-10: ordinal not in range(128) #197

Closed
iLibra opened this issue Oct 26, 2017 · 3 comments

Comments

@iLibra
Copy link

iLibra commented Oct 26, 2017

I'm using vscode-code-runner on MACOS with python2.7
if I print some Chinese Char to output window. it will meet this error:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-10: ordinal not in range(128)

I have tried to submit an issue for VSCode, however VSCode author thinks it's code-runner plugin issue.
because code-runner runs python with not UTF-8 but ascii.
if I run the python in Terminal, everything goes well.

@formulahendry
Copy link
Owner

Hi @iLibra , you could try the solution in #25 (comment)

@iLibra
Copy link
Author

iLibra commented Nov 4, 2017

@formulahendry ,hi , thanks, yes ,the solution in #25 works. before I submit this issue, I already use that method as a workaround, but I hope it can be fixed by root cause. otherwise every user must spend a lot of time to find this solution. and you also should spend a lot of time to explain it one by one.

@nianqinianyi
Copy link

Mac and python3.6.
It did't work when I use #25 (comment),
but it finally works when I set "code-runner.runInTerminal" as #25 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants