解决python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xbc in position 124: illegal multibyte sequence问题

久曲健 / 2023-08-09 / 原文

示例代码:

with open(base_path + "\\config\\user.json",encoding='utf-8') as f:
    data = json.load(f)
    print(data)


效果: