Url verification code $ str % C3 % F7 % D0 % C7 % CD % AC % BF % EE % D7 % B0 % B1 % B8; $ strurldecode ($ str ); & nbsp; If the above two lines of code are saved in gbk, the display is positive. if the code is saved as utf, the display is abnormal. why? How can the code be properly stored as utf? ------ solution -------------------- available url verification code
$ Str = "% C3 % F7 % D0 % C7 % CD % AC % BF % EE % D7 % B0 % B1 % B8 ";
$ Str = urldecode ($ str );
If the above two lines of code are saved in gbk, the positive display is displayed. if the code is saved as utf, the display is abnormal. why?
How can the code be properly stored as utf?
------ Solution --------------------
Use iconv to convert gbk into utf8
$ Str = "% C3 % F7 % D0 % C7 % CD % AC % BF % EE % D7 % B0 % B1 % B8 ";
$ Str = urldecode ($ str );
$ Str = iconv ("GBK", "UTF-8", $ str );
Echo $ str;