rpc4django : convert escaped unicode to characters for textarea

77 views
Skip to first unread message

wgw

unread,
Jul 15, 2012, 7:48:36 PM7/15/12
to django...@googlegroups.com
When an rpc json call returns escaped unicode  from python (something like \u00e8), how do I  decode in javascript those escaped characters? (Is it really as complicated as indicated here:  http://www.rishida.net/tools/conversion/conversionfunctions.js)

I tried the rpc functions at http://rpc4django.davidfischer.name/ . Mytestmethod with special characters. It returns escaped unicode, so è + à + é gives  "\u00e8\u00e0\u00e9". How do I transform that into characters that I can display on the page in, say, a textarea? I'm assuming this has to be done on the javascript side.

from rpc4django:

{
"id": "djangorpc",
"method": "rpc4django.mytestmethod",
"params": [
   "è","à","é"
]
}

I get  {"result": "\u00e8\u00e0\u00e9", "id": "djangorpc", "error": null}


Reply all
Reply to author
Forward
0 new messages