http://www.perlmonks.org?node_id=396549


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

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.