Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Line separator differences between Unix and Win...

Line separator differences between Unix and Windows - an aide memoire

Download for perfect quality - Line separator differences between Unix and Windows - an aide memoire.

Philip Schwarz

June 15, 2019
Tweet

More Decks by Philip Schwarz

Other Decks in Programming

Transcript

  1. scala> import scala.reflect.internal.Chars import scala.reflect.internal.Chars scala> import scala.util.Properties import scala.util.Properties

    scala> Properties.osName res10: String = Mac OS X scala> Set( | | Properties.lineSeparator, | System.getProperty("line.separator"), | "\n", | 10.toChar.toString, | Chars.LF.toString, | "\u000A" | | ).size == 1 res11: Boolean = true scala> scala> import scala.reflect.internal.Chars import scala.reflect.internal.Chars scala> import scala.util.Properties import scala.util.Properties scala> Properties.osName res10: String = Windows 7 scala> Set( | | Properties.lineSeparator, | System.getProperty("line.separator"), | "\r\n", | List( 13.toChar, 10.toChar).mkString, | List( Chars.CR, Chars.LF ).mkString, | "\u000D\u000A" | | ).size == 1 res11: Boolean = true scala> Line Separator differences between Unix and Windows @philip_schwarz NAME ESCAPE CTRL ASCII ASCII SEQ CHAR DEC HEX Line Feed \n LF 10 A Carriage Return \r CR 13 D