Windows notepad not supporting newline character '\n'

后端 未结 4 1577
陌清茗
陌清茗 2020-11-29 11:14

From my iPhone application I\'m outputting data from text to a file. When opened with windows notepad, the data is all on one line and where there should be a new line a blo

4条回答
  •  执念已碎
    2020-11-29 11:58

    I'm simply output '\n' when i want a new line.

    And starting May 2018 (6 years later), you will get a newline!

    See "Introducing extended line endings support in Notepad" by Michel Lopez (and his tweet)

    For many years, Windows Notepad only supported text documents containing Windows End of Line (EOL) characters - Carriage Return (CR) & Line Feed (LF). This means that Notepad was unable to correctly display the contents of text files created in Unix, Linux and macOS.

    Today, we’re excited to announce that we have fixed this issue!

    Starting with the current Windows 10 Insider build, Notepad will support Unix/Linux line endings (LF), Macintosh line endings (CR), and Windows Line endings (CRLF) as usual.

    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.

    Also note that the status bar indicates the detected EOL format of the currently open file.

    See an .bashrc finally displayed correctly!

提交回复
热议问题