MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / _encode

Function _encode

markdown/html4.py:74–78  ·  view source on GitHub ↗
(text, encoding)

Source from the content-addressed store, hash-verified

72 )
73
74def _encode(text, encoding):
75 try:
76 return text.encode(encoding, "xmlcharrefreplace")
77 except (TypeError, AttributeError):
78 _raise_serialization_error(text)
79
80def _escape_cdata(text, encoding):
81 # escape character data

Callers 1

_serialize_htmlFunction · 0.85

Calls 2

encodeMethod · 0.45

Tested by

no test coverage detected