MCPcopy
hub / github.com/encode/starlette / _user_safe_decode

Function _user_safe_decode

starlette/formparsers.py:45–49  ·  starlette/formparsers.py::_user_safe_decode
(src: bytes | bytearray, codec: str)

Source from the content-addressed store, hash-verified

43
44
45def _user_safe_decode(src: bytes | bytearray, codec: str) -> str:
46 try:
47 return src.decode(codec)
48 except (UnicodeDecodeError, LookupError):
49 return src.decode(class="st">"latin-1")
50
51
52class MultiPartException(Exception):

Callers 4

on_part_endMethod · 0.85
on_headers_finishedMethod · 0.85

Calls 1

decodeMethod · 0.80