2.7/3.4 encoding corrected
parent
58b8492783
commit
28c2a4e6ad
|
@ -18,7 +18,7 @@ from pdfminer.utils import isnumber
|
|||
|
||||
ESC_PAT = re.compile(r'[\000-\037&<>()"\042\047\134\177-\377]')
|
||||
def e(s):
|
||||
if isinstance(s,six.binary_type):
|
||||
if six.PY3 and isinstance(s,six.binary_type):
|
||||
s=str(s,'latin-1')
|
||||
return ESC_PAT.sub(lambda m:'&#%d;' % ord(m.group(0)), s)
|
||||
|
||||
|
|
Loading…
Reference in New Issue