def _unicode(string):
for encoding in ['<STR_LIT:utf-8>', '<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>result = unicode(string, encoding)<EOL>return result<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>result = unicode(string, '<STR_LIT:utf-8>', '<STR_LIT:replace>')<EOL>return result<EOL>
Try to convert a string to unicode using different encodings