I guess I'm left with no choice but to look at the contents of the file.
I just wanted to mention that even inspecting the file does not always provide a guarantee of making the determination accurately.
For instance, it is possible, just by coincidence (isolated case), to have a file that is treated as a binary file by some program that is entirely made of bytes in the range 32..127 which would normally be thought of as text but is interpreted by the app in a "binary" way.
Basically, it is possible to determine if a file is _not_ text but, what looks like a text file may be actually be a binary file (interpretation-wise.)
Depending on the reason for determining the file type, keeping that possibility in mind may be important.