Back to Intellij Community

coding=utf-8

python/python-psi-impl/resources/inspectionDescriptions/PyMandatoryEncodingInspection.html

2025.3-rc-2272 B
Original Source

Reports a missing encoding comment in Python 2.

Example:

class Book(object):
    def __init__ (self):
        pass

When the quick-fix is applied, the missing comment is added:

# coding=utf-8
class Book(object):
    def __init__ (self):
        pass