Slashdot Mirror


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

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.

7 of 291 comments (clear)

  1. Why has it been an annoyance? by 91degrees · · Score: 4, Informative

    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.

  2. Re:Mac OS and macOS? by Yaztromo · · Score: 2, Informative

    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

  3. Re:too little, too late by arglebargle_xiv · · Score: 3, Informative

    It's also Windows 10 Bleeding Edge Edition only, so it's still not going to help that many people.

  4. The funny thing... by Slartibartfast · · Score: 5, Informative

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

  5. Re:too little, too late by Megol · · Score: 4, Informative

    ...ending lines properly ...

    CR: return to first character of the line.
    https://en.wikipedia.org/wiki/...

    LF: jump to the next line.
    https://en.wikipedia.org/wiki/...

    Perhaps you should read those articles (I've only verified the relevant parts so normal Wikipedia cautions apply), understand where the control characters came from, what they were used for and why there are different line endings out there? No "properly" about this.

    That it have taken this long for MS to change something this trivial is strange though. Guess they always assumed nobody use notepad?

  6. Re:CRLF is technically correct by Registered+Coward+v2 · · Score: 5, Informative

    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.

    --
    I'm a consultant - I convert gibberish into cash-flow.
  7. ProDOS, UNIX, and CP/M newlines by tepples · · Score: 4, Informative

    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, 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.