Ivan, Your problem looks like a common encoding problem. The default encoding used in server of GAE is ASCII, but something else such as UTF-8 on your computer. So the code works in your development environment but not on Google server.
To deal with this problem you need to declare the encoding in file header and decode your string to unicode with the proper charset before using it. If you don't do this, the Python interpreter will help you to do it with the system default one. I agree this is a little confusing. Python should do it more elegantly. For Matthew's problem, sorry I also have no idea about it. urlfetch is a mystery in GAE libs. I found several examples working good in local but throwing error on server. So I can only suggest you avoid touching the dangerous zone like braces in url. :-) -- George App Engine Unit Test Framework http://code.google.com/p/gaeunit/ On May 4, 5:35 pm, Ivan Maslov <[email protected]> wrote: > I have similar problem. On development server function urlencode works > correctly with unicode string. In production error occurs: > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe2' in position > 2: ordinal not in range(128). It occurs when i pass russian strings as > parameter. > > 2009/5/4 Matt Trinneer <[email protected]> > > > > > To further that post... > > > It seems to me that URLs containing characters such as ( and ) are not > > being fetched properly on the production environment. I've attempted > > escaping the characters, as per RFC 3986. However the escaped url > > (http://dbpedia.org/resource/Companion_%28manga%29) doesn't fair any > > better. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
