The source encoding regex is directly from the PEP

Added a note as suggested by Marius
Added safeguard for deranged one-line scripts.

Should never ever happen, of course, but somewhere in the universe exists a
distutils script with just the `#!bin/python` line... Added a len() to guard
against that.