Jake Larrimore
2014-09-19 16:51:46 UTC
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)
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)
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.