Lookuperror : unknown encoding : utf-8

Sachin Punjabi sachinpunjabi at gmail.com
Mon Oct 30 03:23:18 EST 2006



On Oct 30, 12:42 pm, "Leo Kislov" <Leo.Kis... at gmail.com> wrote:
> Sachin Punjabi wrote:
> > 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.What OS? Where did you get your python distribution? Anyway, I believe
> utf-8 codec was in the python.org distribution since the introduction
> of unicode (around python 2.0). If you can't use utf-8 codec right out
> of the box, something is really wrong with your setup.
>
>   -- Leo

The OS is Windows XP and also how do I incorporate python distribution.
Disutils folder exists in the python folder. Anything I need to do
there ?

Sachin.




More information about the Python-list mailing list