#python #json
Вопрос:
Я хочу прочитать файл json, а затем загрузить его в переменную на Python, но он продолжает выдавать эту ошибку:
File "C:Anaconda3libencodingscp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 5518: character maps to lt;undefinedgt;``` My code looks like this: with open('file.json') as f: loadedfile = json.load(f) Any suggestions?? I have looked at the other answers for similar questions but they all seem to be about text files not json files.
Комментарии:
1. Я также попытался добавить кодировку=’utf-8′