Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

# -*- coding: utf-8 -*- on python3 [duplicate]

Tags:

python

I'm using Python 3.x on windows.

Should I use the # -*- coding: utf-8 -*- declaration on my files? I have read many topics and I think the answer is no but i'm not sure.

Btw i'm writing only in english and italian. Maybe you have to know something else but i don't know what... so ask me

Thank you

like image 660
fabio Avatar asked May 05 '16 10:05

fabio


1 Answers

PEP 3120 defines UTF-8 as the default source encoding for Python 3.x. If you save the file as that encoding (or as ASCII, of course) then no encoding declaration is required.

The What's New In Python 3.0 document declares its implementation.

like image 105
Ignacio Vazquez-Abrams Avatar answered Sep 21 '22 14:09

Ignacio Vazquez-Abrams