I have some non-ASCII characters in a json file. There is a list and that list has strings like SMΛN
. When I read json file and print that list
with open ("strings.json") as f:
t = json.load(f)
print (t)
I got that non-ASCII string like 'SMΛN\n'
. How can I decode it as utf-8
or something like I can print unicode characters properly? I tried this
with open ("strings.json",encoding = 'utf-8') as f:
t = json.load(f).encode('utf-8').decode('utf-8')
But the output is still same.