'Handle character references as data.'

def handle_charref(self, ref):

    if (ref[0] == 'x'):
        data = unichr(int(ref[1:], 16))
    else:
        data = unichr(int(ref))
    if (u'\x80' <= data <= u'\x9f'):
        data = UnicodeDammit.subMSChar(chr(ord(data)), self.smartQuotesTo)
    elif ((not self.convertHTMLEntities) and (not self.convertXMLEntities)):
        data = ('&#%s;' % ref)
    self.handle_data(data)
