Notepad ignoring linebreaks [duplicate]

Most documents I'm opening in notepad.exe under windows 7 lately, there are no linebreaks... everything just runs together. The same documents in any other program, even previewed directly in Explorer, will show the linebreaks correctly. this is happening with many .info files, .css, .js.. but not all of them.

I am guessing it's some kind of character encoding unix line endings something or other, but wondering if there's anything I can do or if anyone else has experienced similar and if I can make notepad work correctly. I prefer it to notepad++/other text editors for certain uses.


Solution 1:

There are line-breaks, however different operating systems recognise different sequences for line-breaks.

Notepad only recognises CR, LF (0x0d, 0x0a), whereas other sources might use CR only, or LF only.

You can't make Notepad behave differently, so your only option is to make sure the content has the right sequence for Notepad. Note that notepad is the only editor with this restriction, so if your content works in Notepad, it will work everywhere else.

One simple way to fix the line-feeds is to copy and paste the text into Word, then back again into notepad, and the line-feeds will get "corrected" to the CR,LF sequence.

Solution 2:

Wordpad

If your aversion to notepad++ and other text editors is that they are not a standard part of all Windows systems, use Wordpad. It's not quite as rudimentary as Notepad.

Wordpad will correctly read and display text files with with Unix line-endings.

Other

If you are averse to both the one-true text editors then notepad++ is probably a good choice.

Solution 3:

As Notepad++ was mentioned specifically in the OP, it (at least now) has the setting needed under:

Edit --> EOL Conversion --> Windows Format.