注意:字符编码为 UTF-8,JOSN区分大小写
布尔型请使用小写 true / false
原始json字符串:
{"URL":"\/ask\/test.api","ContentType":"application\/x-www-form-urlencoded","Params":{"id":8,"name":"\u5F20\u4E09","age":18}}
输出json对象:
URL | /ask/test.api | String
ContentType | application/x-www-form-urlencoded | String
Params | {"id":8,"name":"\u5F20\u4E09","age":18} | Object
⨽ id | 8 | Number
⨽ name | 张三 | String
⨽ age | 18 | Number
jsonObj:
{"URL":"\/ask\/test.api","ContentType":"application\/x-www-form-urlencoded","Params":{"id":8,"name":"\u5F20\u4E09","age":18}}
json.stringify(jsonObj):
{"URL":"\/ask\/test.api","ContentType":"application\/x-www-form-urlencoded","Params":{"id":8,"name":"\u5F20\u4E09"}}
jsonObj.ContentType = application/x-www-form-urlencoded
jsonObj.Params.name = 张三
JOSN字符串转义
'abc"测试"123'.ToJSON 或 StrToJSON('abc"测试"123') ==>
"abc\"\u6D4B\u8BD5\"123"
JSON.Parse('"abc\"\u6D4B\u8BD5\"123"') ==>
abc"测试"123
UnicodeToAnsi('"abc\"\u6D4B\u8BD5\"123"') ==>
"abc\"测试\"123"