MCPcopy Index your code
hub / github.com/bpython/bpython / can_encode

Function can_encode

bpython/config.py:59–64  ·  view source on GitHub ↗
(c: str)

Source from the content-addressed store, hash-verified

57
58
59def can_encode(c: str) -> bool:
60 try:
61 c.encode(getpreferredencoding())
62 return True
63 except UnicodeEncodeError:
64 return False
65
66
67def supports_box_chars() -> bool:

Callers

nothing calls this directly

Calls 1

getpreferredencodingFunction · 0.85

Tested by

no test coverage detected