How can i convert the 'dead'
string to an unicode string u'\xde\xad'
?
Doing this:
from binascii import unhexlify
out = ''.join(x for x in [unhexlify('de'), unhexlify('ad')])
creates a <type 'str'>
string '\xde\xad'
Trying to use the Unicode.join() like this:
from binascii import unhexlify
out = ''.join(x for x in [u'', unhexlify('de'), unhexlify('ad')])
results in an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xde in position 0: ordinal not in range(128)