bugfix: if fontname is bytes then skip (#43)
parent
6cc4abbaa8
commit
61d423d81c
|
@ -275,6 +275,8 @@ def decode_text(s):
|
|||
# enc
|
||||
def enc(x, codec='ascii'):
|
||||
"""Encodes a string for SGML/XML/HTML"""
|
||||
if isinstance(x, bytes):
|
||||
return ''
|
||||
x = x.replace('&', '&').replace('>', '>').replace('<', '<').replace('"', '"')
|
||||
if codec:
|
||||
x = x.encode(codec, 'xmlcharrefreplace')
|
||||
|
|
Loading…
Reference in New Issue