I need to get data from json file to further send it in the post-request. Unfortunately, when i read the file, some unexplained unicode symbols at the beginning
path = '.\jsons_updated'
newpath = os.path.join(path, 'Totem Plus eT 00078-20140224_060406.ord.txt')
file = open(newpath, 'r')
#data = json.dumps(file.read())
data = file.read()
print('data= ', data)
file.close()
Data in the file starts with this:
{"PriceTableHash": [{"Hash": ...
I get the result:
data= п»ї{"PriceTableHash": [{"Hash": ...
or in case of data = json.dumps(file.read())
data= "\u043f\u00bb\u0457{\"PriceTableHash\": [{
So my request can't process this data. Odd symbols are the same for all the files i have.
UPD: If i copy data manyally in the new json or txt file, problem dissappears. But i have about 2,5k files, so that's not an option =)