Don’t use single quotes in JSON

Recently, I used python to deal some JSON data.
When I used a python builtin module — json to extract a json format data (in my opinion), it reported this error:

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes

You can try it by yourself:

import jsonjj = "{'a': 0}"
e = json.loads(jj)
print(e)

The reason of error is : “single quote is not supported in JSON format”

you can see these 2 sentences in json.org

Also you can see these synonymous sentences in W3C.

Just a little sharing.

文字工作者,不過周一到週五寫的都是程式碼。閒暇時間會分享一些心得,包含技術文章或影集書籍觀後感。