MCPcopy Index your code
hub / github.com/RustPython/RustPython / _ENCODE_DIRECT

Function _ENCODE_DIRECT

Lib/_pycodecs.py:981–991  ·  view source on GitHub ↗
(ch, encodeSetO, encodeWhiteSpace)

Source from the content-addressed store, hash-verified

979
980
981def _ENCODE_DIRECT(ch, encodeSetO, encodeWhiteSpace):
982 c = ord(ch) if isinstance(ch, str) else ch
983 if c > 127:
984 return False
985 if utf7_special[c] == 0:
986 return True
987 if utf7_special[c] == 2:
988 return not encodeWhiteSpace
989 if utf7_special[c] == 3:
990 return not encodeSetO
991 return False
992
993
994def PyUnicode_EncodeUTF7(s, size, encodeSetO, encodeWhiteSpace, errors):

Callers 1

PyUnicode_EncodeUTF7Function · 0.85

Calls 2

ordFunction · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected