try: return text.decode('utf-8') except: try: return text.decode('cp1252', 'replace') except: try: return text.decode('iso-8859-1') except: pass