higer <higerinbeij...@gmail.com> wrote:
> My file contains such strings :
> \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a

If those bytes are what is in the file (and it sounds like they are),
then the data in your file is not in UTF8 encoding, it is in ASCII
encoded as hexidecimal escape codes.

> I want to read the content of this file and transfer it to the
> corresponding gbk code,a kind of Chinese character encode style.

You'll have to convert it from hex-escape into UTF8 first, then.

Perhaps better would be to write the original input files in UTF8,
since it sounds like that is what you were intending to do.

--
R. David Murray                 http://www.bitdance.com
    IT Consulting    System Administration    Python Programming

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to