On Thu, Jan 29, 2009 at 12:09 PM, Anjanesh Lekshminarayanan <
m...@anjanesh.net> wrote:

> > It does auto-detect it as cp1252- look at the files in the traceback and
> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong
> > encoding, try opening it as utf-8 or latin1 and see if that fixes it.
>
> Thanks a lot ! utf-8 and latin1 were accepted !
> --
>

If you want to read the file as text, find out which encoding it actually
is. In one of those encodings, you'll probably see some nonsense characters.
If you are just looking at the file as a sequence of bytes, open the file in
binary mode rather than text. That way, you'll avoid this issue all together
(just make sure you use byte strings instead of unicode strings).
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to