Victor wrote...
>TypeError: Odd-length string
>What gives here?
The function unhexlify() wants an even-length string. From the online help:
unhexlify(...)
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:
'A'
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?
Greetings,
--
"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
>>>import binascii
>>>binascii.unh exlify('\x0c')
>>>binascii.unh exlify('\x0c')
>What gives here?
>>help(binascii .unhexlify)
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:
>>binascii.unhe xlify("41")
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?
Greetings,
--
"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