MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / make_escape

Function make_escape

src/__init__.py:18715–18725  ·  view source on GitHub ↗
(ch)

Source from the content-addressed store, hash-verified

18713
18714
18715def make_escape(ch):
18716 if ch == 92:
18717 return "\\u005c"
18718 elif 32 <= ch <= 127 or ch == 10:
18719 return chr(ch)
18720 elif 0xd800 <= ch <= 0xdfff: # orphaned surrogate
18721 return "\\ufffd"
18722 elif ch <= 0xffff:
18723 return f"\\u{ch:04x}"
18724 else:
18725 return f"\\U{ch:08x}"
18726
18727
18728def JM_append_rune(buff, ch):

Callers 2

JM_append_runeFunction · 0.85
JM_copy_rectangleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…