I have a Unicode string in a "narrow" build of Python 2.7.10 containing a Unicode character. I'm trying to use that Unicode character as a lookup in a dictionary, but when I index the string to get the last Unicode character, it returns a different string:
>>> s = u'Python is fun \U0001f44d'
>>> s[-1]
u'\udc4d'
Why is this happening, and how do I retrieve '\U0001f44d'
from the string?
Edit: unicodedata.unidata_version
is 5.2.0 and sys.maxunicode
is 65535.