Really spent a lot of time searching for this. Please need some help.
I am trying to add multilingual feature to my web app framework. For this I am unable to send non ascii characters as JSON. Here is what I am doing
Here is what I get from the database
'\xe0\xa4\xa4\xe0\xa5\x87\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\xa4'
which when I print gives me which is okay
तेस्त
I make the response object
response = {'a':'\xe0\xa4\xa4\xe0\xa5\x87\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\xa4'}
Send the repsonse
import json
sys.stdout.write(json.dumps(response))
This is what it prints
Returns u'{"a": "\u0924\u0947\u0938\u094d\u0924"}'
Any help, pointers will be welcome
Thanks!
Rushabh