diff --git a/src/Request/RequestData.php b/src/Request/RequestData.php index 85db15a..aa0bbb5 100644 --- a/src/Request/RequestData.php +++ b/src/Request/RequestData.php @@ -41,7 +41,7 @@ protected function process() { $params = $this->mergeConduitMetaData($this->rawData, $this->token); - $returnedData['params'] = json_encode($params); + $returnedData['params'] = json_encode(self::array_utf8_encode($params));; $returnedData['output'] = $this->output; //This indicates the API to the client expects conduit response. @@ -67,4 +67,21 @@ protected function mergeConduitMetaData($rawData, $token) { return $params; } + protected function array_utf8_encode($data) + { + if (is_string($data)) { + return utf8_encode($data); + } elseif (is_array($data)) { + $ret = array(); + + foreach ($data as $index => $value) { + $ret[$index] = self::array_utf8_encode($value); + } + + return $ret; + } + + return $data; + } + } } \ No newline at end of file