6

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

1
  • 2
    If you plan write Py2/Py3 portable code, indeed. Btw. -*- sequences are redundant. Commented May 5, 2016 at 11:11

1 Answer 1

9

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Foreign usernames can be a problem?
@fabio foreign usernames should not be a problem while using utf-8

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.