I had a JSON dict as a string. The keys and values were unicode objects like in the following example:
myStringDict = "{u'key':u'value'}"
I could use the byteify
function suggested above by converting the string to a dict
object using ast.literal_eval(myStringDict)
.