Posted on 05/09/2018 9:43:07 AM PDT by dayglored
So happy for you, Microsoft, \r\n
Windows Notepad users, rejoice! Microsoft's text editing app, which has been shipping with Windows since version 1.0 in 1985, has finally been taught how to handle line endings in text files created on Linux, Unix, Mac OS, and macOS devices.
"This has been a major annoyance for developers, IT Pros, administrators, and end users throughout the community," Microsoft acknowledged in a blog post today, without touching on why the issue was allowed to fester for more than three decades.
Notepad's line feed limitations may not inspire the same level of partisan bickering as the tabs vs. spaces debate or the possibility that semicolons may become mandatory in JavaScript.
Nonetheless, the app is widely used and does elicit some passion. News of the change at Microsoft's Build developer conference on Tuesday prompted the loudest cheer of any of the announcements.
"We fixed Notepad," declared Kevin Gallo, head of Windows developer platform.
Notepad previously recognized only the Windows End of Line (EOL) characters, specifically Carriage Return (CR, \r, 0x0d) and Line Feed (LF, \n, 0x0a) together.
For old-school Mac OS, the EOL character is just Carriage Return (CR, \r, 0x0d) and for Linux/Unix it's just Line Feed (LF, \n, 0x0a). Modern macOS, since Mac OS X, follows the Unix convention.
Opening a file written on macOS, Mac OS, Linux, or Unix-flavored computers in Windows Notepad therefore looked like a long wall of text with no separation between paragraphs and lines. Relief arrives in the current Windows 10 Insider Build.
Notepad will continue to output CRLF as its EOL character by default. It's not changing its stripes entirely. But it will retain the formatting of the files it opens so users will be able to view, edit and print text files with non-Windows line ends.
Microsoft has thoughtfully provided an out for Windows users counting on the app's past inflexibility: the new behavior can be undone with a registry key change. ®
But gee, there goes the last reason anyone had to keep "WordPad" around...
UltraEdit rules, NotePad drools.
I was gonna say, if you dont like NotePad, an alternative text editor is a trivial thing.
Ping.
Ping!.................
Well, sure, but when you have to use a stock Windows box to do work with files from other OSes, Notepad is what you get, drool and all, and it's been worthless.
At least now there's hope. :-)
Oh drat I just shot my computer over the weekend. Now what....
Notepad++ myself.
I would be pleasantly surprised if it did all that.
Yeah, context. These are just plain text docs, so there's no useful metadata or header, and the only thing for the editor to do is read until it hits either an LF or a CR, figure out what the EOL looks like, and use that convention for that file.
For newly created files, it will still default to Windows CR-LF sequence.
Other editors have been doing this for 30+ years. It's not rocket science. But until recently, Microsoft refused to play nice with other OSes and so every editor-user in WindowsLand has suffered with the fact that the default Windows editor was brain-dead by design.
See #12 — that’s exactly what it does. Be pleasantly surprised. :-)
CRLF is a holdover from the teletype days. Back when a carriage return really meant return the carriage to the left margin, and line feed moved up the platen.
If you just did a CR without a LF, your next row of type would overstrike the first, useful when creating ASCII art.
Discovered Notepad++ many years ago, never looked back. Especially for editing code / scripts.
Agree.
Egads! I’m old. I still use edlin.exe
For any kind of development (PowerShell, sql, Java, etc.) I use Notepad++. A much better product, handles larger files and it’s free.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.