79446965

Date: 2025-02-18 02:18:16
Score: 1.5
Natty:
Report link

The code is correct but the problem is with the file's encoding.Try converting the file to utf-8 online or use python chardet to automatically detect the right encoding for your json file

import chardet
rawdata = open("test11.json", 'rb').read()
result = chardet.detect(rawdata)
charenc = result['encoding']

with open("test11.json","r", encoding=charenc) as file:
    data = json.load(file)
    print(data)

See about encoding from this other solution on StackOverflow here

Reasons:
  • Blacklisted phrase (1): StackOverflow
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Moreh wa Chege