PrimaveraXERFileWriter encodes LF in memo text as 0x7F 0x7F but leaves CR, so notes with CRLF line breaks don't survive a write and read · Issue #978 · joniles/mpxj · GitHub
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
PrimaveraXERFileWriter encodes LF in memo text as 0x7F 0x7F but leaves CR, so notes with CRLF line breaks don't survive a write and read #978
P6 stores activity notes (TASKMEMO) as HTML with Windows line breaks. When PrimaveraXERFileWriter writes a note whose HTML contains \r\n, it turns each \n into 0x7F 0x7F, as XER expects, but keeps each \r as a raw carriage return in the row:
Reading that XER back with PrimaveraXERFileReader gives an empty note here. On real P6 notes it keeps only the text before the first line break. The same note with \n-only line breaks round-trips intact.
Repro
MPXJ 16.10.0 (PyPI wheel, JPype 1.7.1, OpenJDK 17): one task with
The writer encodes a CRLF pair as 0x7F 0x7F, as P6's own XER export does, and a lone CR the same way, so notes survive a write and read.
Where
XerWriter::formatNotes does result.replace("\n", "\u007F\u007F") and leaves \r alone. That line is unchanged in 16.11.0. Something like result.replace("\r\n", "\u007F\u007F").replace("\r", "\u007F\u007F").replace("\n", "\u007F\u007F") would match P6, but I haven't tested it.
Scale
Every note on a real P6 schedule we read from the database (28 of 28) came back from an MPXJ-written XER cut to its first line.
Activity