In my app, I’m running a following command on Python26 locally:
json.loads(‘”xxxx \ud83d xxxx”‘);
And it parses the string no problem.
But once I upload the code to the GAE server, the following error appears:
"Invalid \uXXXX\uXXXX surrogate pair"
Any suggestions? Could it be because I’m running python2.6 locally, and GAE is running on python2.5?
The string that causes problem is from an API from a well known site, so it’s 100% percent valid. How do I force GAE to parse it correctly?
IMO the json implementations on your computer and on GAE differ. Here is a simplejson implementation which tells you what are the conditions to get the error.
Update: It looks like you have to prefix your string with u like
u"xxxx \ud83d xxxx"