Fix utils.decode_text

pull/4/head
enkore 2014-12-04 17:09:52 +01:00
parent 0e40264071
commit d0379a2c44
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): def decode_text(s):
"""Decodes a PDFDocEncoding string to Unicode.""" """Decodes a PDFDocEncoding string to Unicode."""
if s.startswith(b'\xfe\xff'): if s.startswith(b'\xfe\xff'):
return unicode(s[2:], 'utf-16be', 'ignore') return six.text_type(s[2:], 'utf-16be', 'ignore')
else: else:
return ''.join(PDFDocEncoding[ord(c)] for c in s) return ''.join(PDFDocEncoding[ord(c)] for c in s)