Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Unix Windows Microsoft OS X Operating Systems Software Linux

Windows Notepad Finally Supports Unix, Mac OS Line Endings (theregister.co.uk) 291

Microsoft's text editing app, Notepad, which has been shipping with Windows since version 1.0 in 1985, now supports 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 said in a blog post today. The Register reports: 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.

This discussion has been archived. No new comments can be posted.

Windows Notepad Finally Supports Unix, Mac OS Line Endings

Comments Filter:
  • Notepad++ ? (Score:5, Interesting)

    by Pascal Sartoretti ( 454385 ) on Wednesday May 09, 2018 @02:04AM (#56579010)
    All users caring about line endings had probably migrated to Notepad++ 10 years ago, right ?
    • All users caring about line endings had probably migrated to Notepad++ 10 years ago, right ?

      And yet this is a godsend when working on other people's machines which *don't* have Notepad++

      Even wordpad sucks these days.

      • by arth1 ( 260657 )

        And yet this is a godsend

        Is it, though? I think it is worse than nothing.
        The problem is that it will now read LF, but any new line you put into the text will still have a CR+LF.
        So earlier, when you opened a Unix style text file in Notepad, you would notice that it was LF-based because everything was on one line. So you would open it with Wordpad or something else instead.
        Now, on the other hand, you will open it, see nothing amiss, modify it, and save it, and because the new lines you made will have CR+LF, it may break the system

        • The problem is that it will now read LF, but any new line you put into the text will still have a CR+LF.

          So don't edit python scripts. Seriously though if you're doing something sensitive to CR vs CR+LF then Notepad is the wrong thing to use to edit a file and you'll know it's wrong too. The biggest problem with CR vs CR+LF is being unable to read files (a universal problem) and not that the LF will break the system (a problem that affects an incredibly minor set of possible scenarios exposed to an incredible minor part of the userbase and a part of the user base that is a) most equipped to handle it, and b) l

        • That's worse than nothing in my opinion. A typical Microsoft "solution".

          This typical Microsoft "solution": "New files created within Notepad will use Windows line ending (CRLF) by default, but it will now be possible to view, edit, and print existing files, correctly maintaining the file’s current line ending format."

          It actually is funny to see prejudice just blow up in people's faces.
          https://blogs.msdn.microsoft.c... [microsoft.com]

    • by Mysund ( 60792 )

      Next year Microsoft will release their new feature swollen text editor: Notepad#.

    • All users caring about line endings had probably migrated to Notepad++ 10 years ago, right ?

      Creating a never-ending cycle. Notepad is the only editor you can count on in a workflow, as a result a dependency is built in to a lot of windows apps, and CRLF leaks all over. While on linux/bsd/osx most things obey the EDITOR ev, allowing the user to pick his favorite. As a result if Apple dropped/changed TextEdit, many people may not notice, but if MS drops or changes Notepad, major LOB apps are going to break

      • by timftbf ( 48204 )

        The first tech book on Unix I owned had a section on how you couldn't rely on this newfangled "vi" thing being available, or working from the console, on every system, and both taught and suggested as a default "ed", which is available everywhere.

        I have recovered a very minimally-booting system with "ed" in anger. I don't want to have to do it again any time soon.

        (Also had a great chapter on the joys of booting, and how to use repeated dcheck / icheck iterations to repair filesystems - unless you were on a

      • I've been suggesting they do that for 20 years now.
    • All users caring about line endings had probably migrated to Notepad++ 10 years ago, right ?

      Nope. I just don’t open up anything but Word documents on my Windows machine. Visual Studio already handles the line endings, though it does always try to convert to Windows line endings.

  • Wow. How are they different?

    • Re: (Score:3, Informative)

      by Yaztromo ( 655250 )

      By "Mac OS", they mean versions of Apple's operating system prior to version 10.0.0

      By "macOS", they mean all versions since (and including) 10.0.0.

      (Apple renamed Mac OS X to just "macOS" a year or two ago, to better align with "iOS", "tvOS", and "watchOS" naming, as well as to move away from marketing the OS as "version 10", which they had already done for over 15 years).

      To confuse matters somewhat, early versions of macOS (OS X) could run Mac OS software that used the old-style CR-only line terminator, so

      • And did the line endings change between < 10.0.0 and >= 10.0.0?

        • by tepples ( 727027 ) <.tepples. .at. .gmail.com.> on Wednesday May 09, 2018 @10:37AM (#56581348) Homepage Journal

          Mac OS 1 through 9 use the same newline as ProDOS on the Apple IIe: $0D.
          Mac OS X 10.0 through 10.11 and macOS 10.12 to present use the same newline as UNIX: $0A.
          Traditionally, MS-DOS and Windows have used the same newline as Digital Research's CP/M: $0D $0A.

          The $0D $0A sequence dates back to the Teletype Model 33 terminal [wikipedia.org], one of the first terminals to use ASCII. It could process a carriage return ($0D) and a line feed ($0A) in parallel, but because a return took longer than a line feed, computers sent the return first, then the line feed, then a split second of pausing before the next character so that it wouldn't get smeared across the page during the return. If your Model 33 had the optional ASR paper tape drive, you might have had to use the delete key to insert the pauses yourself.

          UNIX relied on terminal drivers to convert a newline to whatever sequence a particular terminal needed. CP/M just encoded what the terminal expected directly into an application. MS-DOS was originally a clone of CP/M (and DR-DOS was forked from authentic CP/M), and Windows was originally a GUI shell around MS-DOS. Though MS-DOS 2 was sophisticated enough to use these sorts of drivers, it had to remain compatible with applications designed for the much more CP/M-like MS-DOS 1.

      • by cstacy ( 534252 )

        By "Mac OS", they mean versions of Apple's operating system prior to version 10.0.0

        By "macOS", they mean all versions since (and including) 10.0.0.

        (Apple renamed Mac OS X to just "macOS" a year or two ago, to better align with "iOS", "tvOS", and "watchOS" naming, as well as to move away from marketing the OS as "version 10", which they had already done for over 15 years).

        To confuse matters somewhat, early versions of macOS (OS X) could run Mac OS software that used the old-style CR-only line terminator, so the line demarcating the change isn't exactly clean.

        Yaz

        iConfused

      • by Bongo ( 13261 )

        You can export a tab delimited file from FileMaker today, and still get CRs.
        It's like, cute and quaint.

        Ah, fond memories of booting Mac OS X Cheetah (or was it public beta?) on a Quadra 8500 with 130 odd MB of RAM, and it not crashing the whole system whenever an app crashed.

  • by 91degrees ( 207121 ) on Wednesday May 09, 2018 @02:22AM (#56579080) Journal
    Notepad is a small simple text editor that exists because occasionally you might need to edit some text files (typically for config files or something). These will be in a Windows friendly text format. It doesn't pretend to do anything remotely sophisticated.

    If you want to do something more complex then download a non-minimal text editor. There are loads available for free.
    • Imagine those config files are shared with non-windows computers.

    • by Yaztromo ( 655250 ) on Wednesday May 09, 2018 @02:53AM (#56579178) Homepage Journal

      Notepad is a small simple text editor that exists because occasionally you might need to edit some text files (typically for config files or something). These will be in a Windows friendly text format. It doesn't pretend to do anything remotely sophisticated.

      That's great if you're the one running the editor and doing the editing.

      What's not so great is when you give a co-worker a bash script, and they open it in Notepad, and then complain to you about all the extra spacing -- forcing you to waste a ton of breath explaining why it's not a problem with the text file, but an issue with their editor.

      I once had to send a developer at my employer a SQL script intended to be run on Linux, and they did just this. It was unbelievable how long it took me to finally convince them that Notepad was the issue. And it wasn't just the double-spacing; they early had a fit because the file showed up as "ANSI" encoding in Notepad, whereas the spec said the file had to be UTF-8. So not only did I have to convince them (with lots of references) that Notepad was rendering CR/LF as two lines whereas UNIX systems treat them as a single line ending pair, but then I ALSO had to waste a lot of time convincing them that not only is there no such encoding standard as "ANSI" (a very long-standing bug in Notepad Microsoft has never got around to fixing), but that ASCII and UTF-8 are identical for values between 0x00 and 0x7F (which every byte in the document were within).

      It was extremely annoying, because even with lots of links to references as to why they shouldn't be using Notepad for UNIX text files in the first place (and why you can't trust its encoding field), in the end I couldn't convince them. Our DBA eventually had to tell them the file was just fine as-is. And sadly, this wasn't the first person I've had this problem with.

      As such, as a non-Windows user I'm rather happy for this change. I can't believe how many developers I run into who have no notion of line termination or the actual details of encoding standards, and who simply trust whatever Notepad tell them. Hopefully it will save me some aggravation in the future.

      Yaz

      • Reminds me of the time I had to convince a Economics professor. It was a three level course, HS307 or something, Intro to Economics. The solution to the test problem was the equation of a straight line. I gave it in y = m * x + c form. His answer key had this in A x + B y + C = 0 form. Would not accept any of my explanations. I said, " 0.5, 1/2 and 50% are all the same thing" and he had fits, he claimed they are all different. He grudgingly offered partial credit. I had to walk him to a math prof's office
      • Well Microsoft can't fix stupid people. Look on the bright side, due to this issue someone learned something, even brighter would be if you consulted at the time, because then that also translated to billable hours :)

    • Notepad is a small simple text editor that exists because occasionally you might need to edit some text files (typically for config files or something).

      Just because it's simple and occasionally used doesn't mean it can't be annoying. Also just because there are alternatives doesn't mean I'm going to install them on every computer I touch (or even can install them). ... And Wordpad is now a mess.

      • What happened to Wordpad? I used to use it fairly often.
        • Nothing really. It just isn't the program it used to be https://en.wikipedia.org/wiki/... [wikipedia.org]

          You can change some settings force it to look like normal, live with the ribbon, but more fundamentally: It isn't the default text editor. None of this is really a problem, it's just irritating: Help some, open explorer, double click, "crap", close notepad, right click, open in word pad, change the view mode and the wordwrap settings, keep doing what it is you were doing in the first place.

          Notepad not screwing up every

    • by ET3D ( 1169851 )

      I've often encountered downloaded text files which aren't Windows-formatted. While there are many alternatives that do handle line ends correctly (the most readily available in Windows is WordPad), Notepad is a default for various file types and this added support will certainly help.

      This really isn't something basic, not something sophisticated, and there's no particular reason not to include it. While Microsoft is very late to the party, it's a definite case of 'better late than never'.

    • by mjwx ( 966435 )

      Notepad is a small simple text editor that exists because occasionally you might need to edit some text files (typically for config files or something) on a machine that is not yours so doesn't have Notepad++ installed. These will be in a Windows friendly text format. It doesn't pretend to do anything remotely sophisticated.

      If you want to do something more complex then download a non-minimal text editor. There are loads available for free.

      TFTFY. If you're regularly editing text files, Notepad++ (or a contemporary) is essential. Notepad is for when you don't have anything like Notepad++

  • by Anonymous Coward on Wednesday May 09, 2018 @02:26AM (#56579094)

    You want the carriage to return and the paper moved up by one line, not print over the last line (CR only) or continue at the current position one line down (LF only). Imagine that, Microsoft doing something correctly.

    • by Bert64 ( 520050 )

      When printing sure, but most text won't be printed and is just edited electronically. Using a single character makes more sense as it reduces file size, especially if you have short lines.

    • by fisted ( 2295862 )

      Where can I find this paper version of notepad you're talking about?

    • by halivar ( 535827 )

      The deal for me is that, as an old MUD coder in the late 90's, I am so used to the VT100 convention that the Unix way of doing it baffles me. I'm too used to doing \n\r.

    • by Registered Coward v2 ( 447531 ) on Wednesday May 09, 2018 @07:32AM (#56579996)

      You want the carriage to return and the paper moved up by one line, not print over the last line (CR only) or continue at the current position one line down (LF only). Imagine that, Microsoft doing something correctly.

      It's a holdover from the old mechanical printer / typewriter days. Since the LF and CR were handled by separate mechanisms separate commands allowed controlling them independently when needed.

      While in general you wanted a CR and LF, they also had utility themselves. A LF allowed advancing paper without activating the CR mechanism if a CR was not needed, while a CR allows you to over print and blackout text, such as a password.

      • by Misagon ( 1135 )

        Specifically, it is a holdover from the Teletype Corporation telegraphs. Previous Murray telegraphs had used a single "Line" code for a new line.
        The Teletype machines were electro-mechanical and while a character could be typed relatively quickly, the printer's carriage return operation was slow.
        The "Line" code was split into two codes to allow the printer to keep up!

      • It's not just a holdover: it's also a compromise after different OS builders tried to simplify things the same way without coordinating and whose arbitrary choices happened to conflict. Once you have unixy LF and macish CR in the wild, reviving the old CRLF admixture made an equally unhappy compromised. That compromise was baked into telnet and subsequent protocols. By the time Microsoft brought MS-DOS to market, CRLF looked like the sensible, standards-compliant choice.

        I am mostly summarizing the old EOLst [rfc-editor.org]

        • Good points. It's interesting to see how technological solutions prior to the development of computers and OS impact and influence decision made in the new technology, sometimes minor and other times having greater impact.
  • by johannesg ( 664142 ) on Wednesday May 09, 2018 @02:31AM (#56579108)

    Or will this be backported to Windows 7?

  • by najajomo ( 4890785 ) on Wednesday May 09, 2018 @03:35AM (#56579302)
    'Microsoft's text editing app, Notepad, which has been shipping with Windows since version 1.0 in 1985, now supports 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,"'

    You cannot be serious, what professional developer in his right mind would use Notepad?
    • Developers have clients who aren't developers. I don't use Windows, but I'm happy about this change because occasionally I've had clients who wanted to edit one of my files in Notepad and would find it looking broken to them because of lack of line break parsing.

    • You cannot be serious, what professional developer in his right mind would use Notepad?

      Close to 100% of them. Just not necessarily while developing. Kind of like just because vi is my editor of choice doesn't mean that I don't frequently end up on a test system opening something in nano or *shudders* emacs.

      Developers especially frequently send files cross platforms onto test systems they don't administer and need to use a standard OS image. God forbid they remotely access a file on another system, or their main OS from another OS.

    • You cannot be serious, what professional developer in his right mind would use Notepad?

      Any developer having to do a change of an ini file or script on a locked down machine where no user software can be installed, such as a machine in a production environment or factory.

      And any developer who has to guide a user in such a change over the phone or a remote connection.

      Making Notepad actually useful is a huge step in reducing the pain of maintaining Windows based automation and enterprise solutions.

    • You cannot be serious, what professional developer in his right mind would use Notepad?

      Those same senior developers that use pico and nano, I would assume.

  • by nuckfuts ( 690967 ) on Wednesday May 09, 2018 @04:03AM (#56579398)
    I don't know whether it handles Mac OS files, but Unix text files open just fine in Wordpad (which like Notepad is part of every Windows installation).
    • WordPad works on Mac OS files just fine. I use notepad++ if it's available because WordPad defaults to a proportional font, which makes code and script really hard to read...but in a pinch, WordPad will do.

  • This is geared at people working with mixed deployment systems on Azure. And it's great. Honestly, this has been my most wished for feature in Windows for a long, long time.

    Drop the negativity - a good and useful thing has just happened. Thanks.
    • Just wait until notepad corrupts your file when it writes the file back to disk in CR/LF format... and this will be classed as a "feature".

  • MS write (or.. wordpad?) always supported it and came with windows free so it was never a big deal.
  • The funny thing... (Score:5, Informative)

    by Slartibartfast ( 3395 ) * <ken@jot[ ]rg ['s.o' in gap]> on Wednesday May 09, 2018 @04:30AM (#56579464) Homepage Journal

    Is that edit.exe -- the console-based editor that came out with DOS 5.0 -- *did* support UNIX EOL. Go figger.

    • Most people in the past 20 years didn't care about edit.exe but many did care about notepad, even 100 % linux users like me.. when I had to move some shell scripts, or quick edit some files that were created on Linux, for other people of course.

      Reason MS didn't do this earlier is because majority of people were using Windows .. and they wanted to mess with Linux users in one more way.. and to show to that user base that even simple things as TXT files don't work properly on Linux... just another attempt
      • I have to disagree somewhat. While I will never be guilty of ascribing good things to MS while under Ballmer/Gates, once the web came along, UNIX EOL suddenly became righter -- or at least terribly common. I would have to say it was just sheer hamfisted bluster and pride, moreso than a desire to put the hurt on the (then) microscopic userbase of people like you and me.

        But, really, barring an internal document showing this, it doesn't really matter what we think the reason was.

  • Yawn (Score:2, Interesting)

    by Anonymous Coward

    Wake me up when windows can read EXT4 filesystems, I mean it has only been around for 15 years, is an open standard which could easily have been coded for, and it would be just common sense to do so. Meanwhile linux has been able to read NTFS/FAT/FAT32 for 20+ years.

    But oh yay, linebreaks, lookit all that progress..

  • this app can break
  • by theodp ( 442580 ) on Wednesday May 09, 2018 @07:41AM (#56580036)

    ...in after-hours trading.

  • Being able to handle large files by NOT trying to load a huge file into ram and only noticing after two minutes or 10 that it fails will probably take another 40 years.

  • by Torvac ( 691504 ) on Wednesday May 09, 2018 @08:10AM (#56580188)
    suddenly it got really cold down here for a moment
  • Why does this need to be disabled ever? How is it ever better to ignore obvious line breaks?

  • I just heard that Windows notepad tried to replace MS-DOS edline (line editor https://en.wikipedia.org/wiki/... [wikipedia.org]), but failed as edline is still in Windows 10 !?

A committee takes root and grows, it flowers, wilts and dies, scattering the seed from which other committees will bloom. -- Parkinson

Working...