9

I have been writing:

#!/usr/bin/python3
# -*- coding: utf-8 -*-

But I believe Python3 uses Unicode by default.

zadrozny
  • 1,631
  • 3
  • 22
  • 27

1 Answers1

19

The default encoding for python3 code is utf-8. See python's unicode support.

If you want to support python2.x in the same file or if you want to use a coding other than utf-8, you need that comment, otherwise you can leave it off without any repercussions.

mgilson
  • 300,191
  • 65
  • 633
  • 696