Accentuation error in Visual Studio Output
print('Olá Python!)
Follows some information, about the configuration of my PC.
-
Windows 10 Pro
-
Cmder
Active code page: 850
3 answers
You are probably using the wrong character encoding.
Your question is probably duplicated but I will answer it in the best possible way. To understand well what occurs to you from a look at the post What are the main differences between Unicode, UTF, ASCII, ANSI? , and to close the subject, it is also worth reading this article .
But to quickly solve your problem I will quote a last article from SOen in which demonstrates a simple guide to changing encoding in your Visual Studio:
- open the problematic file in Visual Studio.
- on the File menu click "Advanced Save Options"
- from" Encoding "combo select" Unicode (UTF - 8 ... "
- click OK.
Select the encoding type that suits you, i.e. UTF-8.
Follows below in detail what went right.
This is about editing the settings.json and in code-runner.executorMap, add to following lines:
"code-runner.executorMap": {
"python": "set PYTHONIOENCODING=utf8 && python"
}
Marcio's solution worked here... Or settings.json looked like this:
{
"python.jediEnabled": false,
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"files.autoSave": "afterDelay",
"python.pythonPath": "C:\\Users\\Leandro\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe",
"editor.accessibilitySupport": "off",
"workbench.startupEditor": "newUntitledFile",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"code-runner.executorMap": { "python": "set PYTHONIOENCODING=utf8 && python" }
}