Let's say I have the following two variables:
bob1 = u'bob\xf0\xa4\xad\xa2'
and
bob2 = 'bob\xf0\xa4\xad\xa2'
How can I get the value of bob1 as the value of bob2. AKA, how do I expand Unicode formatting but save the escapped hex value?
If I do this:
bob1.encode('utf8')
'bob\xc3\xb0\xc2\xa4\xc2\xad\xc2\xa2'
It is not right...
Help!
source
share