Accentuation error in Visual Studio Output

print('Olá Python!)

insert the description of the image here

Follows some information, about the configuration of my PC.

  • Windows 10 Pro

  • Cmder

  • Active code page: 850

Author: Marcio, 2018-12-20

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.

 3
Author: Otávio Reis Perkles, 2018-12-20 15:50:35

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"
}

insert the description of the image here

 3
Author: Marcio, 2018-12-20 21:23:54

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" }
}
 1
Author: Ordnael, 2020-03-03 11:08:59