"\n") as the newline character. But there are other possible newlines on different platforms, e.g. CRLF (
"\r\n") on Windows; NEL on EBCDIC-based platforms such as z/OS.
I've created apple/swift#21586 to recognize Unicode newlines in
readLine. This follows the recommendations in §5.8 Newline Guidelines of the Unicode Standard:
The acronym NLF (newline function) stands for the generic control function for indication of a new line break. It may be represented by different characters, depending on the platform... [CR, LF, CRLF, or NEL].
Note that even if an implementer knows which characters represent NLF on a particular platform, CR, LF, CRLF, and NEL should be treated the same on input and in interpretation. Only on output is it necessary to distinguish between them.
R4 A readline function should stop at NLF, LS, FF, or PS. In the typical implementation, it does not include the NLF, LS, PS, or FF that caused it to stop.
Should the default terminator of the
TextInputStreamprotocol be useful? And a
readLinewith an additional