Every so often, if I open a non-text based document in either Microsoft Word or Notepad, it will open a massive file with an endless wall of completely garbled, gibberish text, most of the characters being either rectangle boxes or characters that can’t normally be typed. What does each of these characters represent? What happens if I insert or delete these characters?
Usually files would refuse to open with an incompatible format. How do these text-processing softwares somehow manage to run virtually any file?
In: 15
Every file is just made up of bytes. Each byte is a number between 0 and 255.
Those numbers can be taken to mean *anything*. Different applications just have different conventions for how to read them. Some applications expect the file to be text, so they treat these numbers as letters. Notepad expects each number to represent one letter, with the number 97 representing an `a`, for example.
But other applications might read the same contents differently. If you open a save file for a game, the same 97 might mean something completely different. It might be how much life you have, or which level you have reached. Or it might mean nothing on its own, but combined with a dozen *other* bytes it tells us where in the world the assault rifle dropped.
Notepad is just really stupid, and insists that whatever file you open, it’s gotta be text! We’re going to show every byte as a letter or graphical symbol beceause *that’s what we do*.
Latest Answers