MCPcopy Index your code
hub / github.com/clips/pattern / decode_text

Function decode_text

pattern/web/pdf/utils.py:153–158  ·  view source on GitHub ↗

Decodes a PDFDocEncoding string to Unicode.

(s)

Source from the content-addressed store, hash-verified

151 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
152))
153def 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
161def enc(x, codec='ascii'):

Callers 1

searchMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…