Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Guglielmetti committed Feb 6, 2017
2 parents 1e5db2b + 9439a3a commit 3427dca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pdfminer/pdffont.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ def __init__(self, rsrcmgr, spec, strict=settings.STRICT):
raise PDFFontError('BaseFont is missing')
self.basefont = 'unknown'
self.cidsysteminfo = dict_value(spec.get('CIDSystemInfo', {}))
self.cidcoding = '%s-%s' % (self.cidsysteminfo.get('Registry', b'unknown').decode("latin1"),
self.cidsysteminfo.get('Ordering', b'unknown').decode("latin1"))
self.cidcoding = '%s-%s' % (resolve1(self.cidsysteminfo.get('Registry', b'unknown')).decode("latin1"),
resolve1(self.cidsysteminfo.get('Ordering', b'unknown')).decode("latin1"))
try:
name = literal_name(spec['Encoding'])
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion pdfminer/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
STRICT = True
STRICT = False

try:
from django.conf import settings
Expand Down
6 changes: 4 additions & 2 deletions pdfminer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def choplist(n, seq):

# nunpack
def nunpack(s, default=0):
"""Unpacks 1 to 4 byte integers (big endian)."""
"""Unpacks 1 to 4 or 8 byte integers (big endian)."""
l = len(s)
if not l:
return default
Expand All @@ -223,6 +223,8 @@ def nunpack(s, default=0):
return struct.unpack('>L', b'\x00'+s)[0]
elif l == 4:
return struct.unpack('>L', s)[0]
elif l == 8:
return struct.unpack('>Q', s)[0]
else:
raise TypeError('invalid length: %d' % l)

Expand Down Expand Up @@ -269,7 +271,7 @@ def decode_text(s):
if s.startswith(b'\xfe\xff'):
return six.text_type(s[2:], 'utf-16be', 'ignore')
else:
return ''.join(PDFDocEncoding[ord(c)] for c in s)
return ''.join(PDFDocEncoding[c] for c in s)


# enc
Expand Down

0 comments on commit 3427dca

Please sign in to comment.