Reputation: 1
I have a list of strings that represent big-5 encoded Chinese characters, and I'm trying to print them out as the character and not the alphanumeric string. I've tried encode() and decode() with no success.
For example, one of the strings is 'a7da', and I want it to print 我
string = 'a7da'
string.decode('big5)
This just produces the error 'str' object has no attribute 'decode'.
This does work:
string = b'\xa7\xda'
string.decode('big5')
This gives me back '我'
But how can I get 'a7da' into b'\xa7\xda' format?
Upvotes: 0
Views: 491