Skip to content

Commit

Permalink
added php versioning for iconv_set_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
PChristie37 committed May 1, 2018
1 parent 62fd73a commit 619a483
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/FBAInboundServiceMWS/Client.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
i<?php
/*******************************************************************************
* Copyright 2009-2014 Amazon Services. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
9 changes: 6 additions & 3 deletions src/MWSFinancesService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,12 @@ private function _convertGetServiceStatus($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(version_compare(PHP_VERSION, '5.6.0', '<')) {
iconv_set_encoding('output_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
}

$this->_awsAccessKeyId = $awsAccessKeyId;
$this->_awsSecretAccessKey = $awsSecretAccessKey;
Expand Down
10 changes: 6 additions & 4 deletions src/MWSMerchantFulfillmentService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,12 @@ private function _convertGetServiceStatus($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(version_compare(PHP_VERSION, '5.6.0', '<')) {
iconv_set_encoding('output_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
}

$this->_awsAccessKeyId = $awsAccessKeyId;
$this->_awsSecretAccessKey = $awsSecretAccessKey;
if (!is_null($config)) $this->_config = array_merge($this->_config, $config);
Expand Down
8 changes: 5 additions & 3 deletions src/MWSRecommendationsSectionService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,11 @@ private function _convertGetServiceStatus($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(version_compare(PHP_VERSION, '5.6.0', '<')) {
iconv_set_encoding('output_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
}

$this->_awsAccessKeyId = $awsAccessKeyId;
$this->_awsSecretAccessKey = $awsSecretAccessKey;
Expand Down
8 changes: 5 additions & 3 deletions src/MWSSubscriptionsService/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,11 @@ private function _convertGetServiceStatus($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(version_compare(PHP_VERSION, '5.6.0', '<')) {
iconv_set_encoding('output_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
}

$this->_awsAccessKeyId = $awsAccessKeyId;
$this->_awsSecretAccessKey = $awsSecretAccessKey;
Expand Down

0 comments on commit 619a483

Please sign in to comment.