Rasmus​.krats​.se

This page in English

Inlägg taggade ”fileinput”

Skriverier då och då, på webben sedan 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.