[ELI5] Why does Notepad display a wall of garbled text when opening a non-.txt file?

507 views

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

13 Answers

Anonymous 0 Comments

>What does each of these characters represent?

Each garbled character represents Notepad’s attempt to interpret the file’s contents as regular ASCII — regular characters, in other words. A file is nothing more than a stream of binary numbers, so Notepad does its best to divide the stream into chunks and translate those chunks into characters.

>Usually files would refuse to open with an incompatible format.

That’s only if programs are written specifically to do so. Notepad is very simple, and so it assumes that what you’ve given it is something it can work with.

Word isn’t as simple as Notepad, but it’s not programmed to fail, so it’ll do its best too.

You are viewing 1 out of 13 answers, click here to view all answers.