[info] Why can’t windows ( notepad ) display Linux text files properly?

Have you ever tried loading a text files created from Linux text editors like “Gedit” from the windows text editor like Notepad and failed to display the text file properly?

If yes , then you might have been confused why don’t notepad displays text files created from Linux properly , While Linux editors can smoothly display text files created from windows.

Here is an answer for your question.

To find out the answer first of all we should be familiar with the way any program or text editors saves the file. As you might have known computers only understands information in bit level or the information in binary form and computer cannot interpret the texts and symbols you type into your text editor.

When you type the texts into your text editor then while saving the file , the text editor saves the file as a collection of binary data which is equivalent to the Binary of ASCII code of the characters you type into.

So in the core of the text editor every file you save is saved in the binary form , you can see the binary or hexadecimal data of any text file or any type of file using a HEX text editor such as Bless Hex Editor ( htt/home.gna.org/bless.html ) , And now we are going to use the Bless Hex Editor to find out why is it that windows text files can be displayed by Linux properly but windows cannot display Linux text files properly.

So first of all Let’s make two text files one using Notepad (Windows ) and another using Gedit ( Linux ) and load both files into the Bless Hex Editor to see what is the difference between this files?

So here is the screen shot of bless hex editor displaying the Hex Data of both files:


Linux Text file as loaded from Bless Hex Editor

Linux Text file as loaded from Bless Hex Editor





Windows Text file as loaded from Bless Hex Editor

Windows Text file as loaded from Bless Hex Editor




Can you find any difference in the HEX data of the files above?

For your ease I have underlined the difference between the Hex data of two files!

You can see in the Linux file I have underlined “0A” Hex data and in the windows file I have underlined “0D 0A” Hex data!

So that’s the main difference between Windows and Linux file all other contents are same (Some difference is due to the different text saved in two files) . So what does that “0A” and “0D” hex means?

“0D” Hex data stands for “Carriage return” which was used in primitive computers to return the printing carriage of printers to the starting point for printing in next line.

And “0A” Hex stands for Line feed or a blank line.

Some windows text editors still make use of now fossilised characters like “0D” and when ever you try to load Linux text files into notepad Notepad expects the “0D” character along with “0A” but as Linux editors don’t use it Notepad have problems displaying Linux files , But Linux editors have no problem with an extra “0D” attached by windows so Linux editors can easily display windows text files.

No related posts.