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

Method get_encoding

pattern/web/pdf/encodingdb.py:44–58  ·  view source on GitHub ↗
(klass, name, diff=None)

Source from the content-addressed store, hash-verified

42
43 @classmethod
44 def get_encoding(klass, name, diff=None):
45 cid2unicode = klass.encodings.get(name, klass.std2unicode)
46 if diff:
47 cid2unicode = cid2unicode.copy()
48 cid = 0
49 for x in diff:
50 if isinstance(x, int):
51 cid = x
52 elif isinstance(x, PSLiteral):
53 try:
54 cid2unicode[cid] = name2unicode(x.name)
55 except KeyError:
56 pass
57 cid += 1
58 return cid2unicode

Callers

nothing calls this directly

Calls 3

name2unicodeFunction · 0.85
getMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected