def decode_string(v, encoding="utf-8"):
    if isinstance(encoding, basestring):
        encoding = ((encoding,),) + (("windows-1252",), ("utf-8", "ignore"))
    if isinstance(v, str):
        for e in encoding:
            try: return v.decode(*e)
            except:
                pass
        return v
    return unicode(v)
Returns the given value as a Unicode string (if possible).
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/decode_string