Configurable Line Encoding


#1

Hello,

is it possible to change the line encoding when saving a BPMN diagram to XML?
Or is it always the UNIX style?

When I use the following code, a UNIX line encoding ‘n’ is used:

function saveDiagram(done) {

    modeler.saveXML({
        format: true
    }, function (err, xml) {
        done(err, xml);
    });
}

Is it possible to configure Windows or MAC style line endings, e.g. ‘\r\n’ or ‘\r’ ?


#2

You cannot configure the line-endings, it will always be LF for exported XML.

I’d suggest you to pipe the output through a LF to CRLF converter.


#3

Okay, thank you so much for the clarification!

One last question:
Do I have to convert the files back to LF before importing the diagram, or is it always possible to import a diagram, regardless of which line ending is used?


#4

I don’t know. We have been around since 2014 and no-one ever reported a LF / CRFL related issue.

If you’d like the definitive answer I’d suggest you to create a test case that verifies the behavior.