Question about entering an invalid string in PHP prompt in Firefox browser ajax authentication username 1. IE10 is normal
2. Firefox and Alibaba Cloud travel will report an error
The following error is prompted when you enter Chinese characters.
( ! ) Notice: iconv(): Detected an illegal character in input string in D:\wamp\www\cangku\checkname.php on line 7Call Stack#TimeMemoryFunctionLocation10.0011243120{main}( )..\checkname.php:020.0087252736iconv ( )..\checkname.php:7
The seventh line is as follows:
$inputName = iconv("gbk//ignore","utf-8",$inputName);
I was trying to use ajax to verify the existence of user names and so on. The test in the company is good. when I come back to my home, the test will go wrong. I am worried about compatibility issues, so I 'd like to ask for advice.
There is no problem with IE 11. the company's computer is a 360 browser, and there is no problem with it. it will be a problem with Firefox, and win10's built-in browser will not work either.
Reply to discussion (solution)
Really worried!
Is someone there ???? Ask
$ InputName = iconv ("gbk", "UTF-8 // ignore", $ inputName );
$ InputName = iconv ("gbk", "UTF-8 // ignore", $ inputName );
There is still an error. I will cut a picture.
In addition, this card reader exists in the database, which means that every time the pass is garbled or null, it is available.
Try this function. mb_convert_encoding ($ inputName, 'utf-8', 'gbk ')
Try this function. mb_convert_encoding ($ inputName, 'utf-8', 'gbk ')
Thank you for your help.
Output, because the character encoding is UTF-8, so no conversion is required. if the conversion is performed, an error is returned! The answer is the same as the one I found here!
Moreover, I made a huge mistake. the code I have been modifying is no longer on the server, but a source file I backed up from the company!
My days