- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Joomla Troubleshooter. How to deal with “Deprecated function iconv_set_encoding()” error
March 31, 2015
This tutorial will show you how to deal with ‘iconv_set_encoding()’ error during Joomla installation in php 5.6 environment.
Joomla Troubleshooter. How to deal with “Deprecated function iconv_set_encoding()” error
The error may look like the following:
Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in public_html\joomla\libraries\joomla\string\string.php on line 27 Deprecated: iconv_set_encoding(): Use of iconv.input_encoding is deprecated in public_html\joomla\libraries\joomla\string\string.php on line 28 Deprecated: iconv_set_encoding(): Use of iconv.output_encoding is deprecated in public_html\joomla\libraries\joomla\string\string.php on line 29
Let’s see how to deal with this issue.
-
Open the file string.php in ‘public_html\joomla\libraries\joomla\string\’ directory. Go to the line 27.
-
Now change the lines below:
if (function_exists('iconv')) { // These are settings that can be set inside code iconv_set_encoding("internal_encoding", "UTF-8"); iconv_set_encoding("input_encoding", "UTF-8"); iconv_set_encoding("output_encoding", "UTF-8"); }
-
to the following:
if (function_exists('iconv') && PHP_VERSION_ID < 50600) { // These are settings that can be set inside code iconv_set_encoding("internal_encoding", "UTF-8"); iconv_set_encoding("input_encoding", "UTF-8"); iconv_set_encoding("output_encoding", "UTF-8"); } elseif (PHP_VERSION_ID >= 50600) { ini_set("default_charset", "UTF-8"); }
This should resolve the problem and let you proceed to the next level during Joomla installation:
Feel free to check the detailed video tutorial below:
Joomla Troubleshooter. How to deal with “Deprecated function iconv_set_encoding()” error