Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Distinguishing text from binary data

by dave_the_m (Parson)
on Oct 05, 2004 at 10:17 UTC ( #396540=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Distinguishing text from binary data
in thread Distinguishing text from binary data

No it isn't a file - it's a body of an HTTP response
In that case, is examining the Content-type: header in the response sufficient?

Dave.


Comment on Re^3: Distinguishing text from binary data
Download Code
Re^4: Distinguishing text from binary data
by gothic_mallard (Pilgrim) on Oct 05, 2004 at 11:52 UTC

    I'd tend to agree that the simplest course would probably be to check the headers that came with the data - they should give you the content-type as well as the encoding without you having to make assumptions about what makes the code binary or otherwise.

    --- Jay

    All code is untested unless otherwise stated.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://396540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-07 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls