Unicode Decode Error
ian.g.kelly at gmail.com
Sat Oct 9 00:59:19 CEST 2010
On Fri, Oct 8, 2010 at 3:31 PM, Pratik Khemka <pratikkhemka at hotmail.com>wrote:
> *UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position
> 152: ordinal not in range(128)*. Can someone please help me with this
> The error occurs in line *wbk.save(p4_merge.xls)*. I have used *
> import xlwt*..Can someone just tell what do I need to do to get rid of
> this error. I read other forums which explain the error but do not solve it.
> Thanks in advance..
You're writing non-ascii data to the workbook, which is then trying to
decode it using the default ascii encoding, which will fail. When you
create the workbook, you need to specify the correct encoding, e.g.:
wbk = xlwt.Workbook('utf-8')
or whatever encoding you're actually using.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list