Problem/Motivation

The db log is now full of error messages:
Deprecated function: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in MarketplaceWebServiceProducts_Client->__construct() (line 848 of /home/vnb/public_html/sites/all/modules/amazonMWS/libraries/nonapod/AmazonMWS/MarketplaceWebServiceProducts/Client.php).

I claim this was triggered by a hoster changing the default PHP version to 5.6. The error is not reported on PHP 5.4.3

Note that the actual error is in the external Nanopod library code and not the MWS module.

The offending code is:

        iconv_set_encoding('output_encoding', 'UTF-8');
        iconv_set_encoding('input_encoding', 'UTF-8');
        iconv_set_encoding('internal_encoding', 'UTF-8');

Proposed resolution

Not sure? I have not yet investigated the fix.

Comments

Anonymous’s picture

giffenk created an issue.

Anonymous’s picture

I found a note in the php documentation regarding this issue:
http://php.net/manual/en/function.iconv-set-encoding.php#116169

a newer note provides more information:
http://php.net/manual/en/function.iconv-set-encoding.php#119888

travis-bradbury’s picture

Looks like there's 9 places in nonapod/AmazonMWS that should be fixed:

$ grep -HInr iconv_
MarketplaceWebServiceReports/Client.php:92:	iconv_set_encoding('output_encoding', 'UTF-8');
MarketplaceWebServiceReports/Client.php:93:    iconv_set_encoding('input_encoding', 'UTF-8');
MarketplaceWebServiceReports/Client.php:94:    iconv_set_encoding('internal_encoding', 'UTF-8');
MarketplaceWebServiceFeeds/Client.php:92:	iconv_set_encoding('output_encoding', 'UTF-8');
MarketplaceWebServiceFeeds/Client.php:93:    iconv_set_encoding('input_encoding', 'UTF-8');
MarketplaceWebServiceFeeds/Client.php:94:    iconv_set_encoding('internal_encoding', 'UTF-8');
MarketplaceWebServiceProducts/Client.php:846:        iconv_set_encoding('output_encoding', 'UTF-8');
MarketplaceWebServiceProducts/Client.php:847:        iconv_set_encoding('input_encoding', 'UTF-8');
MarketplaceWebServiceProducts/Client.php:848:        iconv_set_encoding('internal_encoding', 'UTF-8');

Here's the source of the information from the comments on the iconv_* documentation about setting default_charset instead :

http://php.net/manual/en/iconv.configuration.php

For this, UTF-8 is already the default since PHP5.6. http://php.net/manual/en/ini.core.php#ini.default-charset