UnicodeDecodeError: 'gbk' codec can't decode byte 0xab in position 11126: illegal multibyte sequence


Run python error appears as shown:

 


Provided corresponding to the encoding format is provided when opening a file encoding format, such as: add encoding = "utf-8"
Solution:

 

with open(self.file_path,encoding="utf-8") as fp:
  data = json.load(fp)
  return data

 



Guess you like

Origin www.cnblogs.com/CesareZhang/p/11866030.html