# python | 读文件编码问题 | UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 34: illegal mu

By [quantdao.eth](https://paragraph.com/@fanguohui) · 2021-12-22

---

    UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 34: illegal multibyte sequence
    后面处理数据时没有转码下，如open函数上 
     处理如下
    with open("data.txt",'r',encoding='UTF-8') as data:

---

*Originally published on [quantdao.eth](https://paragraph.com/@fanguohui/python-unicodedecodeerror-gbk-codec-can-t-decode-byte-0x80-in-position-34-illegal-mu)*
