Get document as normal text and not as binary data
Diez B. Roggisch
deetsNOSPAM at web.de
Mon Mar 28 13:26:45 EST 2005
Markus Franz wrote:
> Diez B. Roggisch wrote:
>
>> You get what the server sends. That is always binary - either it _is_ a
>> binary file, or maybe in an unknown encoding.
>
> And how can I convert those binary data to a "normal" string with
> "normal" characters?
There is no "normal" - it's just bytes, and a string is just bytes. No
difference, no translation necessary.
As others have said: look into the http header what the server is trying to
transmit - maybe an image. The mimetype header is telling you that.
Or use wget to fetch the url and look what you get - it shouldn't look
different.
--
Regards,
Diez B. Roggisch
More information about the Python-list
mailing list