Function: python-info-encoding

python-info-encoding is a byte-compiled function defined in python.el.gz.

Signature

(python-info-encoding)

Documentation

Return encoding for file.

Try python-info-encoding-from-cookie, if none is found then default to utf-8.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-info-encoding ()
  "Return encoding for file.
Try `python-info-encoding-from-cookie', if none is found then
default to utf-8."
  ;; If no encoding is defined, then it's safe to use UTF-8: Python 2
  ;; uses ASCII as default while Python 3 uses UTF-8.  This means that
  ;; in the worst case scenario python.el will make things work for
  ;; Python 2 files with unicode data and no encoding defined.
  (or (python-info-encoding-from-cookie)
      'utf-8))