Characters Being Misread
motoom at xs4all.nl
Tue Jul 15 16:15:39 CEST 2008
>>>> import binascii
>TypeError: Odd-length string
>What gives here?
The function unhexlify() wants an even-length string. From the online help:
a2b_hex(hexstr) -> s; Binary data of hexadecimal representation.
hexstr must contain an even number of hex digits (upper or lower case).
This function is also available as "unhexlify()"
And you use it like this:
You feed it data without any '0x' prefixes.
What are you trying to do? Parsing an RTF file which contains unicode
characerts, encoded as hexadecimal?
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Vallopillil
More information about the Python-list