Continue with this post's question: http://bbs.csdn.net/topics/390901967
I had the wrong post and thought that I had solved the problem.
So please continue to guide the Master Guide it! Thank you very much!
Review of major issues:
Old Post 24 floor xuzuning's reply:
The Tip function should be written like this
function Tip ($code, $msg) { $arr [' code '] = Iconv (' GB2312 ', ' UTF-8 ', $code); $arr [' msg '] = iconv (' GB2312 ', ' UTF-8 ', $msg); Die (Json_encode ($arr));}
Thank you! It did return, but there was a problem:
$ (". Tscg4"). HTML (DATA.MSG);
The value of data.msg into Bang Yukata
How to change back: The transaction password cannot be the same as the login password! It?
Please continue to advise, thank you very much!
Reply to discussion (solution)
alert (data.msg);
Cut a picture
Wait a moment, is on the net can not find the suitable, really good conversion UTF-8 encoding to GB2312 function.
But my page has a tag in the head.
Should not be garbled ah!
alert (data.msg);
Cut a picture
You pass a string constant to the tip function, so your program file is not utf-8?
What is your browser? What is the PHP version? I can't reproduce your phenomenon here.
Anyway, we need to see the tip output.
Your tip function can also be written.
function Tip ($code, $msg) { $s = sprintf (' {"Code": "%s", "MSG": "%s"} ', $code, $msg); Die (Iconv (' GBK ', ' utf-8 ', $s));}
Landlord's program files and is not UTF8?
Are there any additional pages ?
If not, first change to UTF8 test again.
You pass a string constant to the tip function, so your program file is not utf-8?
What is your browser? What is the PHP version? I can't reproduce your phenomenon here.
Anyway, we need to see the tip output.
Your tip function can also be written.
function Tip ($code, $msg) { $s = sprintf (' {"Code": "%s", "MSG": "%s"} ', $code, $msg); Die (Iconv (' GBK ', ' utf-8 ', $s));}
Thanks for the reply, the Tip function is written so that Ajax can not return to the original page,
I said on the 2 floor of this post, is not found on the internet suitable, really useful conversion UTF-8 encoding to GB2312 function.
But my page has a tag in the head.
Should not be garbled ah!
The program file is not utf-8, what does it mean? Refers to PHP files? SafeinfoAction.class.php or functions.php (inside the tip function)?
I open these two files, save as on the page there: Unicode normalization form: C (canonical decomposition, followed by canonical synthesis)
If your program file is Utf-8, then why $arr [' msg '] = iconv (' GB2312 ', ' UTF-8 ', $msg);?