def ja_enc(string):
    """ Encodes an ascii, unicode, or utf-8 to utf-8, hopefully without making a fuss """
    try:
        s = str(string)
    except:
        s = string
    try:
        d = s.decode('utf-8', 'ignore')
    except:
        d = s
    try:
        e = d.encode('utf-8', 'ignore')
    except:
        e = d
    return e
