From c4c0a36e4f18bbb782ab87e07528fbc81ce6ddeb Mon Sep 17 00:00:00 2001 From: Andrew Baumann Date: Mon, 25 Feb 2019 13:08:04 -0800 Subject: [PATCH] name2unicode(): handle hexadecimal constants for unicode glyphs fixes #183, #229 --- pdfminer/encodingdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfminer/encodingdb.py b/pdfminer/encodingdb.py index 870bd28..468b3db 100644 --- a/pdfminer/encodingdb.py +++ b/pdfminer/encodingdb.py @@ -6,7 +6,7 @@ from .latin_enc import ENCODING import six # Python 2+3 compatibility -STRIP_NAME = re.compile(r'[0-9]+') +STRIP_NAME = re.compile(r'[0-9A-Fa-f]+') ## name2unicode @@ -18,7 +18,7 @@ def name2unicode(name): m = STRIP_NAME.search(name) if not m: raise KeyError(name) - return six.unichr(int(m.group(0))) + return six.unichr(int(m.group(0), base=16)) ## EncodingDB