MCPcopy
hub / github.com/pyload/pyload / decode

Function decode

module/plugins/internal/misc.py:412–425  ·  view source on GitHub ↗

Encoded string (default to own system encoding) -> unicode string

(value, encoding=None, errors='strict')

Source from the content-addressed store, hash-verified

410
411#@NOTE: Revert to `decode` in Python 3
412def decode(value, encoding=None, errors='strict'):
413 """
414 Encoded string (default to own system encoding) -> unicode string
415 """
416 if isinstance(value, str):
417 res = unicode(value, encoding or get_console_encoding(sys.stdout.encoding), errors)
418
419 elif isinstance(value, unicode):
420 res = value
421
422 else:
423 res = unicode(value)
424
425 return res
426
427
428def transcode(value, decoding, encoding):

Callers 15

_processMethod · 0.70
fixurlFunction · 0.70
parse_nameFunction · 0.70
format_excFunction · 0.70
listMethod · 0.70
_logMethod · 0.70
_logMethod · 0.70
failMethod · 0.70
_logMethod · 0.70
_update_nameMethod · 0.70
failMethod · 0.70
_create_packagesMethod · 0.70

Calls 1

get_console_encodingFunction · 0.70

Tested by

no test coverage detected