开发者

Decoding json escape sequences

开发者 https://www.devze.com 2023-02-08 17:10 出处:网络
Having created开发者_如何转开发 a text file with a JSON object (from an array) using json_encode, I\'m now supposed to decode the same object. However, with json_decode, the unicode escape sequences d

Having created开发者_如何转开发 a text file with a JSON object (from an array) using json_encode, I'm now supposed to decode the same object. However, with json_decode, the unicode escape sequences don't seem to be properly converted back.

Here is the example of a string from the JSON file:

S\u00720066006f006cd industriomr\u00640065

After json_decoding, the text becomes:

Sr0066006f006cd industriomrd0065

Any idea what's going on here?


The decoding seems to work fine; the final text does indeed correspond with the encoded one. What was the object like before encoding?

0

精彩评论

暂无评论...
验证码 换一张
取 消