Beispiel #1
0
def handler(x):
    """ Callback to convert entity to UC """
    v = x.group(1)
    if v.startswith('#'):
        try:
            return unichr(int(v[1:]))
        except ValueError:
            pass
    return entitydefs.get(v, '')
Beispiel #2
0
def handler(x):
    """ Callback to convert entity to UC """
    v = x.group(1)
    return entitydefs.get(v, '')