6.1.4. sphinx.util.detect_encoding

sphinx.util.detect_encoding(readline)[source]

Like tokenize.detect_encoding() from Py3k, but a bit simplified.