Hexadecimal list conversion

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Dec 20 16:03:33 EST 2007


En Thu, 20 Dec 2007 12:51:33 -0300, Peter Otten <__peter__ at web.de>  
escribió:

> Mark T wrote:
>
>> "Gabriel Genellina" <gagsl-py2 at yahoo.com.ar> wrote in message
>
>>> If you got that from a file, I bet you read it using the wrong
>>> encoding. Try opening the file using codecs.open("filename", "rb",
>>> encoding="utf-16-be") instead of plain open.
>
>> There is an odd number of bytes in each string.  Each begins and ends
>> with \x00, so it doesn't look like utf-16-be.
>
> I think Gabriel is right. The OP probably butchered the original  
> structure
> with
>
> open(filename).read().split("\n")

Sure! I take bets on this too.

-- 
Gabriel Genellina




More information about the Python-list mailing list