name2unicode(): handle hexadecimal constants for unicode glyphs

fixes #183, #229
pull/230/head
Andrew Baumann 2019-02-25 13:08:04 -08:00
parent b6a5848208
commit c4c0a36e4f
1 changed files with 2 additions and 2 deletions

View File

@ -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