Merge pull request #4 from enkore/master

Fix utils.decode_text
pull/6/head
Philippe Guglielmetti 2014-12-05 09:58:58 +01:00
commit 448aa08bc4
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ PDFDocEncoding = ''.join(six.unichr(x) for x in (
def decode_text(s):
"""Decodes a PDFDocEncoding string to Unicode."""
if s.startswith(b'\xfe\xff'):
return unicode(s[2:], 'utf-16be', 'ignore')
return six.text_type(s[2:], 'utf-16be', 'ignore')
else:
return ''.join(PDFDocEncoding[ord(c)] for c in s)