How to solve the garbled code of php7 iconv and mb_convert_encoding?

I have tried the following ways, either garbled or reported an error.

$strInput = "Li Li ad ss";

/ / output is normal, no garbled
echo $strInput;

/ /: iconv (): Unknown error
echo iconv ("utf-8","gb2312",$strInput);

/ / garbled
echo iconv ("utf-8","gb2312//IGNORE",$strInput);

/ / garbled
echo iconv ("utf-8","GBK",$strInput);

/ / garbled
echo mb_convert_encoding ($strInput, "GBK", "UTF-8");

/ / garbled
echo mb_convert_encoding ($strInput, "GBK");

Mar.10,2022

the main question is what kind of encoding is set in the charset of your page?


is the encoding of the file normal? Try creating a new file using notpad+

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4972d-44278.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4972d-44278.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?