import unicodedata


def is_control(ch):
    """判断'char'是否是Control or Format"""
    if ch == "\t" or ch == "\n" or ch == "\r":
        return False
    cat = unicodedata.category(ch)
    # Cc表示Control Cf表示Format
    if cat in ("Cc", "Cf"):
        return True
    return False