Why do binary files appear to have multiple text colours when opened in a text editor?

840 views

Why do binary files appear to have multiple text colours when opened in a text editor?

In: Technology

2 Answers

Anonymous 0 Comments

Sometimes the text editor tries to find a file type it’s used to opening as the binary file’s type and colours it like it would that kind of file.

Anonymous 0 Comments

That depends on the editor. Editors are used to working with text mode only and often have different coloring based on context. The ASCII set is 256 characters (more for Unicode but let’s keep it simple). All the upper/lowercase letters, numbers, etc. Some ASCII symbols are used for newline, tab, space, etc and others have other control meanings (non-printable characters). To an editor it doesn’t know what type of file it is, and might display non-printable characters in a different color.