def encode_utf_8(string_in):
    return string_in.encode('utf-8') if isinstance(string_in, unicode) else string_in
safely encode unicode string to string
dataset/ETHPy150Open Ron89/thesaurus_query.vim/autoload/thesaurus_query/tq_common_lib.py/encode_utf_8