iconv( "UTF-8", "gb2312//IGNORE" , $FormValues['a'])
ignore means to ignore errors during conversion. It is found that iconv will make an error when converting the character "—" to gb2312. If not ignore parameter, all strings following this character cannot be saved.
In addition, mb_convert_encoding does not have this bug, so the best way to write it is:
mb_convert_encoding($FormValues['a'], "gb2312", "UTF-8");
But you need to enable the mbstring extension library first.
You can also set the collation of the mysql database to utf-8 and it will not be used for conversion.
The above introduces the bug solution for converting the regular script gb2312 PHP iconv function to gb2312, including the content of regular script gb2312. I hope it will be helpful to friends who are interested in PHP tutorials.