This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taras.prokopenko
Recipients Brian.Merrell, belopolsky, bob.ippolito, ezio.melotti, merrellb, petri.lehtinen, pitrou, rhettinger, serhiy.storchaka, taras.prokopenko, tchrist, vstinner
Date 2013-10-16.19:05:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381950333.08.0.543478117209.issue11489@psf.upfronthosting.co.za>
In-reply-to
Content
You should use ensure_ascii=False option to json.dumps, ie

import json
unicode_bytes = '\xed\xa8\x80'
unicode_string = unicode_bytes.decode("utf8")
json_encoded = json.dumps(unicode_string, ensure_ascii=False)

json.loads(json_encoded),unicode_string
(u'\uda00', u'\uda00')
cmp(json.loads(json_encoded),unicode_string)
0
History
Date User Action Args
2013-10-16 19:05:33taras.prokopenkosetrecipients: + taras.prokopenko, rhettinger, bob.ippolito, belopolsky, pitrou, vstinner, ezio.melotti, merrellb, Brian.Merrell, petri.lehtinen, tchrist, serhiy.storchaka
2013-10-16 19:05:33taras.prokopenkosetmessageid: <1381950333.08.0.543478117209.issue11489@psf.upfronthosting.co.za>
2013-10-16 19:05:33taras.prokopenkolinkissue11489 messages
2013-10-16 19:05:32taras.prokopenkocreate