这是我的一些代码,我正在尝试将字典转换为包含波斯语字符的 json,但我得到的是问号而不是字符。我的字典看起来像这样:
\n\nbycommunity("0": [{"60357": "\xd8\xa7\xdb\x8c\xd9\x86 \xdb\x8c\xda\xa9 \xd9\xbe\xdb\x8c\xd8\xa7\xd9\x85 \xd8\xa7\xd8\xb3\xd8\xaa"}] )\n\nwith open(\'data.json\', \'wb\') as f:\nf.write(json.dumps(bycommunity).encode("utf-8"))\nRun Code Online (Sandbox Code Playgroud)\n\n结果是:
\n\n{"0": [{"60357": "?????? ??? ??? ???? ???????? ??????"}]} \nRun Code Online (Sandbox Code Playgroud)\n