Skip to content
Snippets Groups Projects
Commit 389c4c37 authored by Mike Ryan's avatar Mike Ryan
Browse files

Revert Issue #2799353 by rachel_norfolk: json_decode() assumes utf8 content -...

Revert Issue #2799353 by rachel_norfolk: json_decode() assumes utf8 content - let’s make sure it gets it
parent cb224c67
No related branches found
No related tags found
No related merge requests found
...@@ -42,12 +42,8 @@ class Json extends DataParserPluginBase implements ContainerFactoryPluginInterfa ...@@ -42,12 +42,8 @@ class Json extends DataParserPluginBase implements ContainerFactoryPluginInterfa
*/ */
protected function getSourceData($url) { protected function getSourceData($url) {
$response = $this->getDataFetcherPlugin()->getResponseContent($url); $response = $this->getDataFetcherPlugin()->getResponseContent($url);
// json_decode() expects utf8 data so let's make sure it gets it.
$utf8response = utf8_encode($response);
// Convert objects to associative arrays. // Convert objects to associative arrays.
$source_data = json_decode($utf8response, TRUE); $source_data = json_decode($response, TRUE);
// Backwards-compatibility for depth selection. // Backwards-compatibility for depth selection.
if (is_int($this->itemSelector)) { if (is_int($this->itemSelector)) {
return $this->selectByDepth($source_data); return $this->selectByDepth($source_data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment