def to_utf8(thing):
    if type(thing) == dict:
        return hash8(thing)
    elif type(thing) in (list, tuple):
        return [v.encode('UTF-8') if type(v) == unicode else to_utf8(v)
                for v in thing]
    elif type(thing) == unicode:
        return thing.encode('UTF-8')
    else:
        return thing
Returns version of thing with all unicode strings converted to UTF8
dataset/ETHPy150Open njr0/fish/fish/fishlib.py/to_utf8