blob: d1d81297cc624fb9ad10667b4a08c9929f0d23ac (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# SPDX-License-Identifier: BSD-3-Clause
"""Shared character validation helpers."""
import unicodedata
def is_control_character(character: str) -> bool:
"""Identify Unicode control characters, including C0, DEL, and C1.
:param character: Unicode character to classify.
:returns: ``True`` for C0, DEL, or C1 control characters.
"""
return unicodedata.category(character) == "Cc"
|