def html_decode(s):
htmlCodes = (
("'", '''),
[...]
('é', 'é')
)
for code in htmlCodes:
s = s.replace(code[1], code[0])
return s
class WordsTable(tables.Table):
[...]
def render_bibl(self, value):
return html_decode(value)
我正在解码该列,因为它包含ä
或é
之类的内容。这样做时,django-tables2给出了以下错误:The string that could not be encoded/decoded was: ��