Decodes a PDFDocEncoding string to Unicode.

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