When binaries are read from the repository and converted to a string, this should be done using UTF-8 encoding. This is currently not the case which can result in issues on Windows OS
From Jeroen Reijn:
"We noticed that the jcr:content node did contain a jcr:mimeType property (set to application/octet-stream), but is lacking the jcr:encoding property.
Now because it did work on my machine we assumed that it wasn't in the code that synchronized this, but it had to be somewhere else.
Setting the file.encoding was a hunch, but later I tracked it down to:
Where the inputstream of the file is copied to a String. We use
String template = IOUtils.toString(stream);
Now looking at the Javadoc explains what happens:
Get the contents of an <code>InputStream</code> as a String
- using the default character encoding of the platform.
So on windows that's not UTF-8 hence it broke."
Thanks Jeroen for tracing down this issue! Nice catch!