age old problem - best way to check if file is text
I've searched and searched for a definitive answer to the problem of how to tell if an opened file is a text file or not and still have not found one. I'm using a BufferedReader to read a text file as was suggested to me because of its speed and efficiency. It is fast an efficient IF you give it a text file. The problem is that it hangs if you give it anything else. So I'm asking you guys, the experts, how do you handle the case where you tell the user to select a text file but they select an executable or some other binary file instead? What is your bomb proof solution?