Detecting an ASCII text file
Posted on 1997-11-20
Is there any way to detect that a file that Delphi has opened for input and is reading, is an ASCII text file? In other words, if the user tries to open a ZIP file or a binary executable file, is there a way to detect that this file is not ASCII and flash an error?
I know you can set file masks and all that in the Open Dialog box, but is there a way I can check the input files content programmatically and sound an alarm if it's not readable ASCII text?