[UnicodeEncodeError] Don't know what else to try

"Martin v. Löwis" martin at v.loewis.de
Fri Nov 14 11:39:00 EST 2008


Gilles Ganault wrote:
> On Fri, 14 Nov 2008 11:01:27 +0100, "Martin v. Löwis"
> <martin at v.loewis.de> wrote:
>> Add
>>                        print type(output)
>> here. If it says "unicode", reconsider the next line
>>
>>> 			print output.decode('utf-8')
> 
> In case the string fetched from a web page turns out not to be Unicode
> and Python isn't happy, what is the right way to handle this, know
> what codepage is being used?

Can you first please report what happened when you add the print statement?

Thanks,
Martin



More information about the Python-list mailing list