Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Testing Sling Mock 1.2.0
-
None
Description
The Sling Mock package allows developers to load content from a json file using the ContentLoader.
ContentLoader.json(JSON_PATH, TARGET)
The actual loading is performed in ContentLoader.java:327 using
IOUtils.toString(inputStream);
As soon as you try to load a UTF-8 encoded JSON (as per default) on a windows platform, this fails due to encoding issues:
"jcr:title": "English Ö",
is loaded as
English [Ö]
As json is per definition UTF-8 encoded, I would suggest to set the encoding explicit by changing the line above to
return IOUtils.toString(inputStream, "UTF-8");