The following unicode and string can exist on their own if defined explicitly:
>>> value_str=\'Andr\\xc3\\xa9\' >>> value_uni=u\'Andr\\xc3\
value_uni.encode('utf8') or whatever encoding you need.
value_uni.encode('utf8')
See http://docs.python.org/library/stdtypes.html#str.encode