Read text files with a specific encoding? using fileinput?

Michael Hudson mwh at python.net
Fri Feb 14 12:04:53 EST 2003


Jim Correia <noone at nowhere.com.invalid> writes:

> 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.)

help(codecs.open), I think.

> If I have a script which processes files on the command line, using 
> fileinput, can I do the same?

Not sure about that one.

Cheers,
M.

-- 
  Just getting something to work usually means writing reams of code
  fast, like a Stephen King novel, but making it maintainable and
  high-quality code that really expresses the ideas well, is like
  writing poetry.  Art is taking away.  -- Erik Naggum, comp.lang.lisp




More information about the Python-list mailing list