MCPcopy Index your code
hub / github.com/prometheus/client_python / _is_valid_utf8

Function _is_valid_utf8

prometheus_client/openmetrics/exposition.py:282–287  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

280
281
282def _is_valid_utf8(s: str) -> bool:
283 if 0 <= ord(s) < _SURROGATE_MIN:
284 return True
285 if _SURROGATE_MAX < ord(s) <= maxunicode:
286 return True
287 return False

Callers 1

_escapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected