This is just JS string escaping, which can be said to be UTF-16 encoding. Just like "A" can be written as "x41", it can also be written as "u0041". It’s just that x is followed by two digits, and u is followed by 4 digits. In ES6, curly brackets can be added for more than 4 digits. "u{10FFF}""x41" 一样,也可以写成"u0041"一样。只是 x后面跟两位是数字,u 跟4位。ES6 里面对于多余4位的可以加大括号。"u{10FFF}"
这样写是为了防止直接写{"code":1003,"msg":"缺少参数"} This is written to prevent garbled characters caused by not setting the appropriate encoding in the http header when writing {"code":1003,"msg":"missing parameters"} directly (this cannot be like Write the same as <meata charset="UTF8"> in the HTML file).
Unicode encoded
Chinese
{"code":1003,"msg":"缺少参数"}
json_encode($a, JSON_UNESCAPED_UNICODE)
See the manual - http://php.net/manual/zh/function.json-encode.php
No need to worry about it, you can use it directly
Somewhat like the JSON RPC model
This is just JS string escaping, which can be said to be UTF-16 encoding.
Just like "A" can be written as
"x41"
, it can also be written as"u0041"
. It’s just thatx
is followed by two digits, andu
is followed by 4 digits. In ES6, curly brackets can be added for more than 4 digits."u{10FFF}"
"x41"
一样,也可以写成"u0041"
一样。只是x
后面跟两位是数字,u
跟4位。ES6 里面对于多余4位的可以加大括号。"u{10FFF}"
这样写是为了防止直接写
So, it’s written like this! 🎜{"code":1003,"msg":"缺少参数"}
This is written to prevent garbled characters caused by not setting the appropriate encoding in the http header when writing
{"code":1003,"msg":"missing parameters"}
directly (this cannot be like Write the same as <meata charset="UTF8"> in the HTML file).Unicode encoding. . The Chinese meaning of its parameters is: missing parameters.
Unicode, just use it