When exactly did Mac OS switch character for new line from '\r' to '\n' ?

I knew about that Mac OS has ever used '\r' character to represent new line, while '\n' later. I want to know the eact time that this change happened, is there a official note? I was trying to search that note on Google, while I still couldn't find that. Thanks in advance.

Posted on Mar 1, 2024 1:08 AM

Reply
5 replies

Mar 1, 2024 6:46 AM in response to DevinJohw

AFAIR the change happened after OS X was released.


I edit almost all text files that need no extra formatting in BBEdit (screenshot below). In the recent past I took care to use Unix (LF), and Windows (CRLF) only if that document was used at work with Windows XP-7-10. But current Windows 10 Notepad and WordPad seem to use all variations including Legacy Mac (CR) OK.


Unicode (UTF-8) etc might still be a headache.


Mar 1, 2024 6:03 AM in response to DevinJohw

Classic macOS used a carriage return and OS X/macOS has always used a newline because of its BSD UNIX heritage. Even NeXTStep/OpenStep used newlines because it was based on 4.2 BSD and the Mach kernel.


Any text file coming from MS Windows has a carriage-return/linefeed pair for line endings and that is incompatible with macOS until these documents are stripped of that carriage-return.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

When exactly did Mac OS switch character for new line from '\r' to '\n' ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.