def to_string(s):
    """desperate attempt to convert a string regardless of what garbage we get"""
    try:
        return s.decode('utf-8')
    except Exception as e:
        pass
    try:
        s2 = s.encode('utf-8', 'ignore')
        x = u'%s' % s2
        return s2
    except Exception:
        pass
    r = ''
    while s != '':
        try:
            r2 = r + s[0]
            s = s[1:]
            r2 = r2.encode('ascii', 'ignore')
            x = u'%s' % r2
            r = r2
        except Exception:
            break
    return r + '_XXX'
