Read text files with a specific encoding? using fileinput?

Boudewijn Rempt boud at
Fri Feb 14 18:06:46 CET 2003

Jim Correia wrote:

> How can I read a test file off disk and interpret it as using a specific
> encoding? (Such as utf-8, iso-latin-1, etc.)

s ="filename", "utf-8").read() does the trick.

Boudewijn Rempt |

More information about the Python-list mailing list