MCPcopy Index your code
hub / github.com/bugy/script-server / decode

Function decode

src/utils/encoding_utils.py:1–8  ·  view source on GitHub ↗
(data, encoding)

Source from the content-addressed store, hash-verified

1def decode(data, encoding):
2 try:
3 return data.decode(encoding)
4 except UnicodeDecodeError as e:
5 if encoding.lower() == 'utf-8':
6 return _decode_utf8_with_mixes(data)
7
8 raise e
9
10
11def _decode_utf8_with_mixes(data):

Callers

nothing calls this directly

Calls 1

_decode_utf8_with_mixesFunction · 0.85

Tested by

no test coverage detected