Decodes a PDFDocEncoding string to Unicode.
(s)
| 151 | 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, |
| 152 | )) |
| 153 | def decode_text(s): |
| 154 | """Decodes a PDFDocEncoding string to Unicode.""" |
| 155 | if s.startswith('\xfe\xff'): |
| 156 | return unicode(s[2:], 'utf-16be', 'ignore') |
| 157 | else: |
| 158 | return ''.join( PDFDocEncoding[ord(c)] for c in s ) |
| 159 | |
| 160 | # enc |
| 161 | def enc(x, codec='ascii'): |
no outgoing calls
no test coverage detected
searching dependent graphs…