in reply to Perl -T vs Mime::Types

Or check that it matches application/octet-stream MIME type

Actually, for your purpose, text/plain would be the appropriate type.

-T is probably good enough to catch any files that aren't yet fully decoded/decompressed/etc.

Caveats: -T will accept valid UTF-8 encoded data as text. Also, even if the data isn't valid UTF-8, it will still allow some non-ASCII bytes and accept it as ASCII text. (The documentation says up to a third of the examined part of the file.)