Hi,

simplejson.dumps(message) is enough, no need for encode('utf-8')


Just checked in SDK Interactive Console:



from django.utils import simplejson as json
print '--- s ---'
s = u'\u0b9e'
print s.encode('utf-8')
print repr(s)
print type(s)
print '--- j ---'
j = json.dumps(s)
print j
print repr(j)
print type(j)
print repr(json.loads(j))



Output:



--- s ---
ஞ
u'\u0b9e'
<type 'unicode'>
--- j ---
"\u0b9e"
'"\\u0b9e"'
<type 'str'> <----------- already of type 'str'
u'\u0b9e'

-- 
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.

Reply via email to