

def convert_body_to_unicode(self, body, bom, charset, ignore_errors, fix_special_entities):
    if bom:
        body = body[len(self.bom):]
    if fix_special_entities:
        body = weblib.encoding.fix_special_entities(body)
    if ignore_errors:
        errors = 'ignore'
    else:
        errors = 'strict'
    return body.decode(charset, errors).strip()

dataset/ETHPy150Open lorien/grab/grab/document.py BodyExtension.convert_body_to_unicode/original