\n and \n\r

What a fuckton of issues those two characters brought me today while attempting to verify a signed file.

  • 6
    Windows vs. TRW
  • 8
  • 3
    \n\r is not used anywhere.
  • 12
    Narrator: And even in a rant the characters \r and \n still gave OP trouble.
  • 1
    CRLF is the only correct line terminator.
  • 3
    @bkwilliams @kescherRant @fnf47 Oh boy, I guess I'm tired
  • 2
    Generally fuck backslashes.
    Took me like two hours of editing escaped JSON so that it would put a String variable value in there.
  • 3
    @stop it's not windows only

    \r (Carriage Return) → moves the cursor to the beginning of the line without advancing to the next line
    \n (Line Feed) → moves the cursor down to the next line without returning to the beginning of the line — In a *nix environment \n moves to the beginning of the line.
    \r\n (End Of Line) → a combination of \r and \n
  • 1
    @dontbeevil \r\n is only used in text-protocols like http and smtp and Windows-files. \n is used in unix, linux and newer macos. \r is used in older macos-versions.
  • 2
    Ever export to CSV and hit \r\n in what should be an unquoted string? What about a \t or even more rare \v. Sometimes there is a \0 and things go boom.
  • 2
    @bkwilliams \0 is an adversary's best friend, people should know this already, it's only been a used trick for... 30 years or more?
Add Comment