def charref(name):
    if name[0] in ['x', 'X']:
        c = int(name[1:], 16)
    else:
        c = int(name)

    if not UNICODE_SNOB and c in list(unifiable_n.keys()):
        return unifiable_n[c]
    else:
        try:
            return chr(c)
        except NameError:  # Python3
            return chr(c)
dataset/ETHPy150Open lsaffre/lino/lino/utils/html2text.py/charref/original