views:

69

answers:

1

Hi!

I am sending POST request from client to the application. On the server side it processed this way:

def report(request):

if request.method == "POST":
    dict = request.POST
    idea = dict["idea"]
    print idea
    return HttpResponse("Success")

If idea = "binding" (or any English word) I get http 200 OK

but on the other hand if idea = "связка" (Russian word), I am getting 500 Error

Could you please suggest a way to fix the issue?


Example of post dictionary:

<QueryDict: {u'tournament': [u''], u'sidetomove': [u'true'], 
u'idea': [u'\u0441\u0432\u044f\u0437\u043a\u0430']}>
+1  A: 

You are getting an error while printing idea. Try this:

print repr(idea)

This is most probably because of a UnicodeDecodeError.

stefanw
How can I fix the error?
Oleg Tarasenko