Home >Backend Development >PHP Tutorial >PHP iconv(): Unknown error (22)_PHP教程

PHP iconv(): Unknown error (22)_PHP教程

WBOY
WBOYOriginal
2016-07-13 17:54:182117browse

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;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477970.htmlTechArticleI 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 to test it. When it is found that it is written as utf8, an error will be reported in PHP Notice: iconv(): Unknown error...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn