Files Delphi

Title: How to check if a file is a text file or a binary one
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
if IsTextFile(OpenDialog1.FileName) then
showmessage('is ascii')
else showmessage('is BinaryFile')
end;
end;