You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UTF-16LE delimiters match at unaligned byte offsets #543
csv-parse can recognize a record or field delimiter starting halfway through a UTF-16LE code unit. Valid characters are then split into empty records or fields, losing the original value.
Reproduced on upstream master 9fabcbe70ac6d3561db8c11fef3a567f7917cdc2 (package.json version 7.0.3), Node.js v24.22.1.
Each input should remain one record containing the two original characters in one field. For the first example, the LF pattern 0a 00 occurs at byte offset 1 across 01 0a | 00 01; it is not a newline code unit. CR and comma exhibit the same behavior.
Additional context
All three failures also reproduce with one-byte stream writes. The same three values parse correctly as UTF-8 controls. Delimiters are explicitly configured; this does not depend on automatic delimiter discovery, BOM detection, or trimming.
Source inspection suggests __isRecordDelimiter() and __isDelimiter() accept these unaligned byte matches. This delimiter-recognition behavior also remains when only the separate line-counting change in #542 is applied.
AI-assisted reproduction and source inspection; all six failing executions and three UTF-8 controls were run locally.
Activity