As reported https://stackoverflow.com/q/70925661/14419 the content of output files can get mangled when writing export files from a Windows machine, unless the default character set is explicitly set as UTF-8 -Dfile.encoding=UTF-8.
Upon investigation, it seems that we are relying on the default system encoding when AbstractTask method getValueAsBytes() invokes getBytes() without specifying the encoding:
|
return item.asString().getBytes(); |
It should instead be:
item.asString().getBytes(StandardCharsets.UTF_8);
As reported https://stackoverflow.com/q/70925661/14419 the content of output files can get mangled when writing export files from a Windows machine, unless the default character set is explicitly set as UTF-8
-Dfile.encoding=UTF-8.Upon investigation, it seems that we are relying on the default system encoding when AbstractTask method
getValueAsBytes()invokesgetBytes()without specifying the encoding:corb2/src/main/java/com/marklogic/developer/corb/AbstractTask.java
Line 469 in a2a8017
It should instead be: