0

I performed ocr on images to extract Arabic content. I stored the output in a text file using

f=open(filename,'w',encoding='utf-8') 
f.write(text)
f.close()

The output in the txt file is readable. But when I read the txt file using

file=open(filename,'r',encoding='utf-8')
json[name]=file.read()

I get this weird encoding that i couldn't solve

enter image description here

1 Answers1

0

It turned out that the problem is from json when using dump I changed ensure_ascii=False and it kept it as it is. same problem but in json