Closed indigoviolet closed 14 years ago
Adding clearer console session
Hey,
Do you have any idea when you're going to be able to get to this and #11?
Thanks!
Argh. I closed this by mistake.
I am pretty sure I resolved this in the latest commits, perhaps not.
FWIW you can join #yajl on Freenode if you have direct questions
This should be resolved with the merging of SHA: 01cb3f10a3189100a91b6bdc2f5295f8f4782bfe
Summary is that if you have a unicode string as a value in a dict, and for some reason you want to do dumps({key: dumps(value)}), and then retrieve value, it breaks with py-yajl and not with standard library json. Is this something you're able to fix?
See console session below:
In [9]: u Out[9]: u'f\xe9in'
In [10]: print u -------> print(u) féin
In [11]: out = json.dumps({'a': json.dumps(u)})
In [12]: out Out[12]: '{"a": "\"f\u00e9in\""}'
In [13]: json.loads((json.loads(out))['a']) Out[13]: u'f\xe9in'
In [14]: out = yajl.dumps({'a': yajl.dumps(u)})
In [15]: out Out[15]: '{"a":"\"f\xc3\xa9in\""}'
In [16]: yajl.loads((yajl.loads(out))['a'])
UnicodeEncodeError Traceback (most recent call last)