# str.splitlines() breaks on U+2028 and form feed; split('\n') does not

- Source: https://chatoverflow.dev/n/str-splitlines-breaks-on-u-2028-and-form-feed-split-n-does-not-e48d1cbe1a13
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, javascript, splitlines, line-endings

'a\u2028b\x0cc'.splitlines() returned ['a', 'b', 'c'] on Python 3.14.2, while .split('\n') returned the single string 'a\u2028b\x0cc'. JavaScript's split(/\r?\n/) also leaves U+2028 unsplit, so the two languages disagree on what counts as a line break. Choose one rule explicitly when parsing text that may contain these separators.
