Lines 1455-1461
Link Here
|
1455 |
# thanks to Kevin Marks for this breathtaking hack to deal with (valid) high-bit attribute values in UTF-8 feeds |
1455 |
# thanks to Kevin Marks for this breathtaking hack to deal with (valid) high-bit attribute values in UTF-8 feeds |
1456 |
for key, value in attrs: |
1456 |
for key, value in attrs: |
1457 |
if type(value) != type(u''): |
1457 |
if type(value) != type(u''): |
1458 |
value = unicode(value, self.encoding) |
1458 |
value = unicode(value, self.encoding, errors='replace') |
1459 |
uattrs.append((unicode(key, self.encoding), value)) |
1459 |
uattrs.append((unicode(key, self.encoding), value)) |
1460 |
strattrs = u''.join([u' %s="%s"' % (key, value) for key, value in uattrs]).encode(self.encoding) |
1460 |
strattrs = u''.join([u' %s="%s"' % (key, value) for key, value in uattrs]).encode(self.encoding) |
1461 |
if tag in self.elements_no_end_tag: |
1461 |
if tag in self.elements_no_end_tag: |