def unicode_convert(input):
if isinstance(input, dict):
return {unicode_convert(key): unicode_convert(value) for key, value in input.iteritems()}
elif isinstance(input, list):
return [unicode_convert(element) for element in input]
elif isinstance(input, unicode):
return input.encode('utf-8')
else:
return input