如何解决python中的解码问题

时间:2019-10-11 11:35:52

标签: python-2.7

当我进入file.txt?%F7%F4%F4%BC%B0%1D%22%C3%C3%C3%03%87aOi%DC%BC%E0%C8%F6En%B7%BB%AD%1DN%B8%5C.[*%B8%1C%0E%C7%8E%9B%B0%CB%1A5%CC%E7%93%89%B6%8E%0E%99%E8X.%03%0DsH%86Z%5E%02%99MK%1B%C9P%DD%BB时,我正在用python读取日志文件。

line='file.txt%F7%F4%F4%BC%B0%1D%22%C3%C3%C3%03%87aOi%DC%BC%E0%C8%F6En%B7%BB%AD%1DN%B8%5C.[*%B8%1C%0E%C7%8E%9B%B0%CB%1A5%CC%E7%93%89%B6%8E%0E%99%E8X.%03%0DsH%86Z%5E%02%99MK%1B%C9P%DD%BB'
line=unquote(line)

打印出来的是sH�Z^�MK7file.txt?���"�aOiܼ�En���N�\.[*�ǎ��5�����

0 个答案:

没有答案