I want to read Chinese file through python code. But i got a messy output.
Following is my code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
with open('1.doc', 'r+') as f:
text = f.readlines()
print text
Output:
\x01\x00\x00\xfe\xff\xff\xffy\x01\x00\x00z\x01\x00\x00{\x01\x00\x00|\x01\x00\x00}\x01\x00\x00~\x01\x00\x00\x7f\x01\x00\x00\x80\x01\x00\x00\x81\x01\x00\x00\x82\x01\
I know that it must have some encode or decode problems in there. But i don't know how to figure it out.