def charref(self, name):
    if (name[0] in ['x', 'X']):
        c = int(name[1:], 16)
    else:
        c = int(name)
    if ((not self.unicode_snob) and (c in unifiable_n.keys())):
        return unifiable_n[c]
    else:
        try:
            return unichr(c)
        except NameError:
            return chr(c)
def charref(self, name):
    if (name[0] in ['x', 'X']):
        c = int(name[1:], 16)
    else:
        c = int(name)
    if ((not self.unicode_snob) and (c in unifiable_n.keys())):
        return unifiable_n[c]
    else:
        try:
            return unichr(c)
        except NameError:
            return chr(c)