I just started to use VSCode on some python scripts. When I try to print something like:
print('%s' % string.decode('utf-8'))
I get following error in output window:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 16-20: ordinal not in range(128)
I know it probably because the output stream is ascii only, but I can't find a place to change it... , either I missed it, or it just the way it is?
I'm using v0.10.8 on Win7 64bit.
Thanks in advance!
I suffer the same problem, it's caused by the the plugin -- Code Runner.
Please check the discussions here:
It suggest to write these into VSCode setting file:
{
"code-runner.executorMap": {
"python": "set PYTHONIOENCODING=utf8 && python"
}
}
if, it doesn't work, you can use this (run the script in terminal):
{
"code-runner.runInTerminal": true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With