Get document as normal text and not as binary data
Markus Franz
mail at markus-franz.de
Tue Mar 29 13:13:47 EST 2005
Kent Johnson wrote:
> My guess is the html is utf-8 encoded - your sample looks like
> utf-8-interpreted-as-latin-1. Try
> contents = f.read().decode('utf-8')
YES! That helped!
I used the following:
...
contents = f.read().decode('utf-8')
contents = contents.encode('iso-8859-15')
...
That was the perfect solution for my problem! Thanks a lot!
Best regards
Markus
More information about the Python-list
mailing list