Detect encoding-tags in python
Posted 2012-04-22 19:50. Tagged fileinput, hack, python, unicode.
When iterating over a set of input files in Python, how to decode the lines of each file with the correct encoding?
I wrote a hook for the fileinput module to look for a -*- coding: foo -*-
marker in the first lines of each file.