What is unicode character 2028 (LS / Line Separator) used for?

后端 未结 2 677
無奈伤痛
無奈伤痛 2020-12-28 12:48

I was thinking to myself that the line breaking problem must be somewhat solved by someone, but maybe not widely adopted. Being forward thinking, I went to search t

相关标签:
2条回答
  • 2020-12-28 13:07

    Nicked from McDowell’s comment on the same page, and indirectly from the Unicode docs:

    Traditionally, NLF started out as a line separator (and sometimes record separator). It is still used as a line separator in simple text editors such as program editors. As platforms and programs started to handle word processing with automatic line-wrap, these characters were reinterpreted to stand for paragraph separators. For example, even such simple programs as the Windows Notepad program and the Mac SimpleText program interpret their platform’s NLF as a paragraph separator, not a line separator.

    NLF (New Line Function) in this context is shorthand for CR, LF and CRLF. By contrast, the two Unicode characters have unambiguous uses.

    0 讨论(0)
  • 2020-12-28 13:12

    Per the Unicode Newline Guidelines, U+2029 paragraph separator (PS) unambiguously indicates an intent to separate paragraphs. U+2028 line separator (LS) does likewise for lines. The other newline function characters, LF, CR, CR+LF, and NEL, are ambiguous, with their meanings dependent on platform and application.

    For example, a LF might separate paragraphs in a word processing application but only lines in a simple text editor. By contrast, PS always separates paragraphs, regardless of the type of application.

    0 讨论(0)
提交回复
热议问题