MCPcopy Create free account
hub / github.com/bugy/script-server / get_encoding

Function get_encoding

src/execution/process_pty.py:151–169  ·  view source on GitHub ↗
(command, working_directory)

Source from the content-addressed store, hash-verified

149
150
151def get_encoding(command, working_directory):
152 encoding = None
153
154 split_command = command
155 if isinstance(command, str):
156 split_command = process_utils.split_command(command, working_directory)
157
158 if split_command and split_command[0]:
159 program = split_command[0]
160 if program in script_encodings:
161 encoding = script_encodings[program]
162
163 if not encoding:
164 if sys.stdout.encoding:
165 encoding = sys.stdout.encoding
166 else:
167 encoding = 'utf-8'
168
169 return encoding

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected