Need to consider cross-platform linebreak handling #2

jonm opened this Issue Jul 7, 2012 · 0 comments


None yet
1 participant

jonm commented Jul 7, 2012

RFC 2046 requires that text/* types use CRLF as linebreaks, which is how the grammar is currently written. However, I suspect that many actual diff outputs would not actually adhere to this on a byte-for-byte basis. In particular, I suspect that most Unix diffs will just use newlines. There are a few possibilities for addressing this:

  • Just allow multiple linebreak types, so long as they are consistent through the file (this is the RFC 2616 approach for HTTP)
  • Register it as application/diff instead of text/diff.
  • Augment the grammar to allow for multiple (but consistent) linebreak styles. This might mean that a newline-terminated patch file might "look" to a generic text/plain processor as a single long line, but maybe that's ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment