我像这样从苹果那里得到了 JSON
{
"original-purchase-date-pst" = "2012-06-28 02:46:02 America/Los_Angeles";
"original-transaction-id" = "1000000051960431";
"bvrs" = "1.0";
"transaction-id" = "1000000051960431";
"quantity" = "1";
"original-purchase-date-ms" = "1340876762450";
"product-id" = "com.x";
"item-id" = "523404215";
"bid" = "com.x";
"purchase-date-ms" = "1340876762450";
"purchase-date" = "2012-06-28 09:46:02 Etc/GMT";
"purchase-date-pst" = "2012-06-28 02:46:02 America/Los_Angeles";
"original-purchase-date" = "2012-06-28 09:46:02 Etc/GMT";
}
这不是我们所知道的JSON 。在 JSON 中,它明确定义为
每个名称后跟 :(冒号),名称/值对用 ,(逗号)分隔。
我什至如何在 python 的 json (或 simplejson )模块中解析它?
json
仅支持separators
in json.dumps()
、 not injson.loads()
和 in simplejson/decoder.py
, the具有and的def JSONObject()
硬编码分隔符。:
,
我能做些什么?写我自己的解析器?