A file contains text data and binary data ... Is it a text file or a binary file?

Roger L Costello costello at mitre.org
Mon Sep 14 16:19:22 CDT 2020

Hi Folks,

Thank you for your outstanding responses!

I am a bit confused about something that Marcus said:

Why do you need to give it a single attribute of "text" or "binary"? It's a bit like asking about the single language of a text that contains paragraphs in different languages.

And Doug said:

I think this is a false dichotomy.
I realize there are binary files that contain text. For example, EXE files contain binary data with islands of text scattered here and there. But the key point, I think, is that EXE is categorized as a binary file and not a text file. And thus EXE files should be displayed/edited using an appropriate hex editor, not a text editor.

Based on the many potential problems you described with using a text editor to display a file that contains text data and binary data, I draw this conclusion: If a file contains binary data, it is a binary file; only if the file contains purely text data is it a text file." Do you agree with this conclusion?


More information about the Unicode mailing list