Some source files, from downloaded code, have the following header
# -*- coding: utf-8 -*-
I have an idea what utf-8 encoding is but why would
A more direct answer:
In Python 3+: you don't need to declare. UTF-8 is the default. Make sure the file is encoded in UTF-8. Some Windows editors don't have it by default. It won't hurt to declare it, and some editors may use it.
In Python 2: always. The default is OS dependent.
And remember: this is just about your source code files. Now in the 3rd millennium the string type does not exist anymore. You must take care of the type text, that is a sequence of bytes and an encoding. You'll still have to define your encoding in all input and output operation. These operations will still be dependent on your environment, so it's still better to follow the rule: Explicit is better than implicit.