MCPcopy Index your code
hub / github.com/secdev/scapy / decode_locale_str

Function decode_locale_str

scapy/utils.py:911–917  ·  view source on GitHub ↗

Decode bytes into a string using the system locale. Useful on Windows where it can be unusual (e.g. cp1252)

(x)

Source from the content-addressed store, hash-verified

909
910
911def decode_locale_str(x):
912 # type: (bytes) -> str
913 """
914 Decode bytes into a string using the system locale.
915 Useful on Windows where it can be unusual (e.g. cp1252)
916 """
917 return x.decode(encoding=locale.getlocale()[1] or "utf-8", errors="replace")
918
919
920class ContextManagerSubprocess(object):

Callers 3

compile_filterFunction · 0.90
__init__Method · 0.90
setfilterMethod · 0.90

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected