MCPcopy Index your code
hub / github.com/openai/plugins / _escape_json_surrogates

Function _escape_json_surrogates

plugins/codex-security/scripts/workbench_db.py:678–682  ·  view source on GitHub ↗
(value: str)

Source from the content-addressed store, hash-verified

676
677
678def _escape_json_surrogates(value: str) -> str:
679 return "".join(
680 f"\\u{ord(character):04x}" if 0xD800 <= ord(character) <= 0xDFFF else character
681 for character in value
682 )
683
684
685def _normalize_preflight_patch(value: Any, index: int) -> dict[str, Any]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected