Taggat fileinput på Rasmus.krats.sehttps://rasmus.krats.se/tag/fileinput.sv2012-04-22T19:50:00+00:00Skriverier då och då, på webben sedan 1994.Detect encoding-tags in pythonhttps://rasmus.krats.se/2012/detect-encoding.en2012-04-22T19:50:00+00:00Rasmus Kajhttps://rasmus.krats.se/rkaj2012-04-22T19:50:00+00:00<p>When iterating over a set of input files in Python, how to decode the
lines of each file with the correct encoding?</p>
<p>I wrote a hook for the fileinput module to look for a <code>-*- coding: foo -*-</code> marker in the first lines of each file.</p>
<p class='readmore'><a href='https://rasmus.krats.se/2012/detect-encoding.en'>Read whole <q>Detect encoding-tags in python</q>.</a></p>