chrischabot / opensocial-python-client

Automatically exported from code.google.com/p/opensocial-python-client
Apache License 2.0
0 stars 0 forks source link

UnicodeEncodeError: 'ascii' codec can't encode characters in position ... #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am using opensocial python client 0.2 to validate requests coming
from orkut to my server. I am mimicking related example in this this
article ->
http://wiki.opensocial.org/index.php?title=Building_an_OpenSocial_App_with_Googl
e_App_Engine,
and it works fine as long as the POST DATA contains only ASCII
characters.

But when the POST DATA contains some non English characters, the
following exception is thrown:

UnicodeEncodeError: 'ascii' codec can't encode characters in position
0-8: ordinal not in range(128)

from inside get_normalized_paramaters (Refer oauth.OAuthRequest). I
think the last line, i.e.

return '&'.join('%s=%s' % (escape(str(k)), escape(str(v))) for k, v in
key_values)

throws the exception.

Googling tells me that this problem was faced earlier by many, but I
could not find any solution.

Reference:
http://groups.google.com/group/opensocial-client-libraries/browse_thread/thread/
c56a8b2f60af1243?hl=en

Original issue reported on code.google.com by skpate...@gmail.com on 6 Jun 2009 at 7:03