Confusion about json_encode () This post was last written by u013037779 at 2014-12-0612: 07: 33. I wrote this in the controller and then output the Json format in a text file. However, the receiver always prompts a system error. Baidu said the encoding is incorrect, but I have written it at the beginning of the acceptor and the UFT-8 code is also specified in the sender controller. I am confused about json_encode ().
This post was last edited by u013037779 at 12:07:33
This is what I wrote in the controller.
Then I output the Json format in a text file;
However, the acceptor always prompts a system error. Baidu says the encoding is incorrect, but I already wrote it at the beginning of the acceptor.
The sender controller also specifies the UFT-8 encoding.
At present, the receiver cannot accept the data and says it is a system error ..
I used window. alert ("OK ");
It proves that the data is returned, but the error is in var t and the system error is always prompted ..
How can this problem be solved?
Can you provide the following code?
------ Solution ----------------------
Then I output the Json format in a text file. the Chinese language uses utf8 encoding. Add the following code in the front-end javascript code:
Data = eval ('+ data +'); // assume that the received content is stored in data.