Besides PyYAML, are there any safe Python data serialization libraries that correctly handle unicode / str ?
For instance:
>>> json.loads(json.dumps([u"x", "x"])) [u'x', u'x']
Note that I want the serializers to be safe (therefore pickle and marshel missing), and PyYAML is an option, but I don't like the complexity of YAML, so I would like to know if there are other options.
Change There seems to be some confusion about the nature of my data. Some of them are Unicode (for example, names), and some of them are binary (for example, images) ... Therefore, a serialization library that confuses unicode and str is useless to me as a library that confuses "42" and 42 .
source share