You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (JIRA)" <ji...@apache.org> on 2015/03/19 13:08:38 UTC
[jira] [Updated] (SLING-4522) Sling Mocks: Contentloader fails for
UTF8 encoded json files on Windows Systems
[ https://issues.apache.org/jira/browse/SLING-4522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert updated SLING-4522:
----------------------------------
Fix Version/s: Testing Sling Mock 1.2.2
Assignee: Stefan Seifert
Summary: Sling Mocks: Contentloader fails for UTF8 encoded json files on Windows Systems (was: Contentloader fails for UTF8 encoded json files on Windows Systems)
> Sling Mocks: Contentloader fails for UTF8 encoded json files on Windows Systems
> -------------------------------------------------------------------------------
>
> Key: SLING-4522
> URL: https://issues.apache.org/jira/browse/SLING-4522
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Affects Versions: Testing Sling Mock 1.2.0
> Reporter: Alexander Muthmann
> Assignee: Stefan Seifert
> Fix For: Testing Sling Mock 1.2.2
>
>
> The Sling Mock package allows developers to load content from a json file using the ContentLoader.
> {code}
> ContentLoader.json(JSON_PATH, TARGET)
> {code}
> The actual loading is performed in ContentLoader.java:327 using
> {code}
> IOUtils.toString(inputStream);
> {code}
> 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:
> {code}
> "jcr:title": "English Ö",
> {code}
> is loaded as
> {code}
> English [Ö]
> {code}
> As json is per definition UTF-8 encoded, I would suggest to set the encoding explicit by changing the line above to
> {code}
> return IOUtils.toString(inputStream, "UTF-8");
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)