simpleJSON pack binary data

Andrey alpha04 at netvigator.com
Sat Jul 21 22:13:22 EDT 2007


Hi

I donno if this is the right place to ask for this question, anyway....

Is it possible to pack binary data into simplejson?

d={}
d['date'] = xxxxxx
d['name'] = xxxxxx
d['size'] = xxxxx

d['imageBinaryDataJpeg'] = jpegBinaryDataFromcStringIOStringIO

simplejson.dumps(d)

when i do this, it raises a UTF8 decode error, probably about the binary 
image data

My question is, anyone will suggest a workaround to this error?
i really like to pack my raw image data into the JSON, so my other 
programming script can read the array easily

Thanks
An K







More information about the Python-list mailing list