Denna sida på svenska

Posts tagged “fileinput”

Reminiscing this and that, on the web since 1994.

Detect encoding-tags in python

Posted 2012-04-22 19:50. Tagged , , , .

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.

Read whole Detect encoding-tags in python.