Linebreaks lost on node.setProperty

I'm having an odd issue where line-break characters in strings are converted to the \n string when copying properties between nodes. The code for copying properties is basically lifted from APOC:

private <T extends PropertyContainer> T copyProperties(Map<String, Object> source, T target) {
    for (Map.Entry<String, Object> prop : source.entrySet())
        target.setProperty(prop.getKey(), prop.getValue());
    return target;
}

Didn't find any Github issues related to this, so I'm wondering what I might be missing? Ideas appreciated.

Hi Jiropole,

The \n character is the Java representation of a newline character within a string, so that seems correct to us.

Thanks Andrew,

Sure, it's the string literal representation, but what I'm seeing is the line break character encoded in the original string being replaced with a literal \n in the copied value, i.e. the value is being transformed, versus copied verbatim. That doesn't seem to make sense, as the code doesn't suggest to me any transformation. Or, if that's a wrong analysis, how would I ensure the value is not transformed when copied?