Hey Group–
I am being passed a string that may contain Unicode in it’s 4-digit format – u’\u4eb0’. I’m asked to be able to display said string in a Richtext and need to decode the Unicode to display as well. Is there a simple way to decode a string that may (or may not) contain Unicode so that when I pass it into richtext.WriteText(text), it knows to display the unicode, without parsing the string to do it manually?
I attached an Example of what I’m dealing with. I can get it to display the Unicode if I pass it in alone–
richtext.WriteText( u’\u4eb0’)
– but if it is in the middle of a string it doesn’t recognize it as Unicode. I’d rather not have to parse the hole thing to search for unicode, I know there must be a simpler way.
Thanks,
Jake
Environment:
Python 2.7/ 32 bit
wxPython 2.8 (unicode version)
richTextCtrl.py (2.48 KB)