I encountered this error today, which is very strange. I tried to recompile and install libiconv and php but failed
I wrote a piece of code and tested it, and found that when it is written as utf8, an error will be reported
PHP Notice: iconv(): Unknown error (22) in /home/web/Liv.php on line 4
If you write it as utf-8, everything will be fine. It seems that habits are very important.
My version is
libiconv-1.13.1
php-5.3.8
[php]
$str="Heyhey";
iconv('gbk','utf8',$str);
//iconv('gbk','utf-8',$str); //This is correct
echo $str;
?>