I tried:
# -*- coding: utf-8 -*-
with open("File1", "w") as outfile:
json.dump( {"Tytuł":"tą"}, outfile, indent = True, encoding="utf-8")
Which gives me:
{
"Tytu\u0142": "t\u0105"
}
What'd I like to get is:
{
"Tytuł": "tą"
}
ensure_ascii=False
works, but when I try to get JSON data from the file, I get UnicodeEncodeError: 'ascii' codec can't encode characters...
The code I'm using for this is:
json_data=open('File0')
data = json.load(json_data)
with open("File1", "w") as outfile:
json.dump( data,outfile,indent = True,ensure_ascii=False)