MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _describe_non_ascii

Function _describe_non_ascii

scripts/code-verify.py:1298–1305  ·  view source on GitHub ↗

Return a short human label for a non-ASCII character. Falls back to the codepoint when the character isn't in the curated table — that way the report names every offender without needing an exhaustive map.

(ch: str)

Source from the content-addressed store, hash-verified

1296
1297
1298def _describe_non_ascii(ch: str) -> str:
1299 """Return a short human label for a non-ASCII character. Falls back to
1300 the codepoint when the character isn't in the curated table — that way
1301 the report names every offender without needing an exhaustive map."""
1302 if ch in _NON_ASCII_NAMES:
1303 return _NON_ASCII_NAMES[ch]
1304 cp = ord(ch)
1305 return f"U+{cp:04X} ({ch!r})"
1306
1307
1308# Translation calls — non-ASCII inside their string args is allowed because

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected