Accent error on Visual Studio output

Asked

Viewed 2,829 times

4

print('Olá Python!)

inserir a descrição da imagem aqui

Here is some information about setting up my PC.

  • Windows 10 Pro

  • Cmder

  • Active code page: 850

  • Which version of python is using?...

  • @Tuxpilgrim Is version 3.7.0

3 answers

3

You’re probably using the Character encoding wrong.

Your question is likely to be duplicate But I will answer you as best I can. To understand well what comes of a look at the post What are the main differences between Unicode, UTF, ASCII, ANSI? , and to close the matter, it is worth also reading that article.

But to quickly solve your problem I will quote one last article from Soen demonstrating a simple guide to changing the 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 type of encoding that suits you, ie UTF-8.

  • I have already made this change and it has no effect. The encoding is listed as UTF-8, both in the status bar and in the Encoding settings. Thank you!

  • Keeps showing the same error ?

  • 2

    I just tested out another solution that I was given and it worked. This is to edit Settings.json and in code-Runner.executorMap, add the following lines: "code-Runner.executorMap": { "python": "set PYTHONIOENCODING=utf8 && python" }

3

Follow below in detail what worked.

This is to edit Settings.json and in code-Runner.executorMap, add the following lines:

"code-runner.executorMap": {
    "python": "set PYTHONIOENCODING=utf8 && python"
}

inserir a descrição da imagem aqui

1

Marcio’s solution worked here... Settings.json became 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" }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.