From 61d423d81c4cada65aee10b31aa033cb459b552a Mon Sep 17 00:00:00 2001 From: Jin-tae Hwang Date: Thu, 15 Dec 2016 01:34:16 +0900 Subject: [PATCH] bugfix: if fontname is bytes then skip (#43) --- pdfminer/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdfminer/utils.py b/pdfminer/utils.py index 9700abf..a6ccabe 100644 --- a/pdfminer/utils.py +++ b/pdfminer/utils.py @@ -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')