Get document as normal text and not as binary data

Diez B. Roggisch deetsNOSPAM at web.de
Sun Mar 27 13:51:46 CEST 2005


Markus Franz wrote:

> Hi.
> 
> I used urllib2 to load a html-document through http. But my problem
> is:
> The loaded contents are returned as binary data, that means that every
> character is displayed like lÀÃt, for example. How can I get the
> contents as normal text?

You get what the server sends. That is always binary - either it _is_ a
binary file, or maybe in an unknown encoding. 

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list