def encode_string(v, encoding="utf-8"):
    if isinstance(encoding, basestring):
        encoding = ((encoding,),) + (("windows-1252",), ("utf-8", "ignore"))
    if isinstance(v, unicode):
        for e in encoding:
            try: return v.encode(*e)
            except:
                pass
        return v
    return str(v)
If `word` is a string, performs a look up for its associated
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/encode_string--crossover with--dataset/ETHPy150Open inpho/vsm/vsm/viewer/types.py/res_word_type