Lookuperror : unknown encoding : utf-8

Sachin Punjabi sachinpunjabi at gmail.com
Mon Oct 30 02:30:24 EST 2006


Hi,

I wanted to read a file encoded in utf-8 and and using the following
syntax in my source which throws me an error specifying Lookuperror :
unknown encoding : utf-8. Also I am working on Python version 2.4.1.

import codecs
fileObj = codecs.open( "data.txt", "r", "utf-8" )

Can anyone please guide me how do I get utf-8 activated in my codecs or
any setting needs to be done for the same before using codecs.

Regards
Sachin Punjabi.




More information about the Python-list mailing list