Python乱码 b'\x1f\x8b\x08\x00\x00\x00\x00\x00\...'

Python里面的编码问题真的让人快疯了..

比如res打印出来是这个b’\x1f\x8b\x08\x00\x00\x00\x00\x00…’

import gzip
ret = gzip.decompress(res).decode("utf-8")

搞定!

猜你喜欢

转载自blog.csdn.net/DylanYuan/article/details/81533105
今日推荐