After a time of PHP + MSSQL, the feeling of MSSQL support for the code is not very good (in fact, I did not grasp it well), but has not yet come to the urgent exchange of databases, only on the point, and today in the submission of data errors.
After a time of PHP + MSSQL, the feeling of MSSQL support for the code is not very good (in fact, I did not grasp it well), but has not yet come to the urgent exchange of databases, only on the point, and today in the submission of data errors.
Because the content of the submitted ntext field is more, about a few KB, so I misunderstood, thinking that the article is too long to cause errors. I look at the PHP configuration, I found that PHP support for Mssql.textsize is already in the K, how wrong? When the error is turned on, it is not the article too long, but the error caused by the encoding. The error is as follows:
| The code is as follows |
Copy Code |
| Notice:iconv () [Function.iconv]: detected an illegal character in input string in .... |
English is really bad, just know iconv () function problem. Google Translate, said to be an illegal character detected in the input string. Dawned.
The solution to finding the problem online based on the error is to add a//ignore to the second parameter of Iconv (), which means ignoring the error. The code is as follows:
| The code is as follows |
Copy Code |
| Iconv ("Utf-8", "Gbk//ignore", $str); |
Tested and submitted successfully.
Note: The Netizen experience, the scope of GBK is bigger than gb2313, so the error rate with GBK coding is smaller than gb2313.
http://www.bkjia.com/PHPjc/632194.html www.bkjia.com true http://www.bkjia.com/PHPjc/632194.html techarticle after a time of PHP + MSSQL, the feeling of MSSQL support for the code is not very good (in fact, I did not grasp it well), but has not come to the urgent exchange of databases, only on the point, today ...