Valid encodings for a Python source file

Terry Reedy tjreedy at udel.edu
Fri Jun 8 02:28:13 EDT 2018


On 6/7/2018 4:40 PM, Daniel Glus wrote:
> I'm trying to figure out the entire list of possible encodings for a Python
> source file - that is, encodings that can go in a PEP 263
> <https://www.python.org/dev/peps/pep-0263/> encoding specification, like #
> -*- encoding: foo -*-.

For new code for python 3, don't use an encoding cookie.  Use an editor 
that can save in utf-8 and tell it to do so if it does not do so by default.

-- 
Terry Jan Reedy




More information about the Python-list mailing list