“\r\n” is one Character in Swift
From the department of “how did I not realise this sooner?!”: Yes, Swift treats the two bytes “\r\n” as a single character. This is actually super convenient a lot of the time, because it means algorithms that look for line breaks with isNewline just work, even on “Windows”-style text. Otherwise, you’d have to explicitly look… Read more