From e8199cc5ace27daf63330140b37ab8afaa4b5303 Mon Sep 17 00:00:00 2001 From: Paul Wright Date: Thu, 7 Oct 2021 13:45:23 +0100 Subject: [PATCH] Updated iconv_set_encoding --- composer.json | 2 +- src/MarketplaceWebServiceOrders/Client.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d4ed3c8..2cdd1b8 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "pjw345/php-amazon-mws", "type": "library", "description": "An open-source library to connect to Amazon's MWS web services in an object-oriented manner, with a focus on intuitive usage.", - "version": "1.2.0", + "version": "1.2.1", "keywords": [ "API", "Amazon", diff --git a/src/MarketplaceWebServiceOrders/Client.php b/src/MarketplaceWebServiceOrders/Client.php index d05a339..4feee58 100644 --- a/src/MarketplaceWebServiceOrders/Client.php +++ b/src/MarketplaceWebServiceOrders/Client.php @@ -413,9 +413,13 @@ private function _convertListOrdersByNextToken($request) { */ public function __construct($awsAccessKeyId, $awsSecretAccessKey, $applicationName, $applicationVersion, $config = null) { - iconv_set_encoding('output_encoding', 'UTF-8'); - iconv_set_encoding('input_encoding', 'UTF-8'); - iconv_set_encoding('internal_encoding', 'UTF-8'); + if (PHP_VERSION_ID < 50600) { + iconv_set_encoding('input_encoding', 'UTF-8'); + iconv_set_encoding('output_encoding', 'UTF-8'); + iconv_set_encoding('internal_encoding', 'UTF-8'); + } else { + ini_set('default_charset', 'UTF-8'); + } $this->_awsAccessKeyId = $awsAccessKeyId; $this->_awsSecretAccessKey = $awsSecretAccessKey;