Visual Studio utf-8 error

2

I tried to use Visual Studio together with the tools for Python , but when I put: print("Hello World") and pressing F5 it runs smoothly.

However, when boto: print("olá") it gives the following error:

File "C:\Users\.... path .....\PythonApplication1\PythonApplication1.py", line 1
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe1 in position 0:
 unexpected end of data
Press any key to continue . . .

I would like to know how to solve!

    
asked by anonymous 02.10.2016 / 02:05

1 answer

1

Try this:

#coding: UTF-8
print('olá')

Depending on the Python version, the encoding used should be specified if you want to use special characters. If that does not work, try this too:

#coding: latin-1
print('olá')
    
22.01.2017 / 18:20