Reputation: 99
Output in Visual Studio Code can't decode Cyrillic characters:
The same code works fine in PyCharm:
How do I quickly fix this issue? There must be some simple way.
Auto Guess Encoding in Settings doesn't work since it's for files, not the output.
Edit: the problem was the Code Runner extension in VSCode. Disabling it or running script in terminal does the job.
Upvotes: 4
Views: 8701
Reputation: 31
The problem lies in the Code Runner encoding itself, since the text is displayed correctly in the terminal.
You can add into settings.json :
"code-runner.executorMap": {"python": "set PYTHONIOENCODING=utf8 && py -u"},
Upvotes: 3
Reputation: 41
You can configure 'Code Runner' plugin to run your code in the integrated terminal.
Try it:
Ctrl + ,
code runner run in terminal
Now your application with Cyrillic symbols run in Integred Terminal without encoding problems.
Upvotes: 4