← 返回
未分类 中文

Wc Chars Tool

Count characters in text input — total, non-whitespace, CJK, and Unicode-aware character counts. Useful for text analysis, content length limits, and i18n va...
统计文本输入的字符数:总数、非空格、CJK、Unicode感知计数。用于文本分析、内容长度限制和 i18n 验证。
dinghaibin
未分类 clawhub v1.0.0 1 版本 99583.3 Key: 无需
★ 0
Stars
📥 239
下载
💾 0
安装
1
版本
#latest

概述

WC Chars Tool — Character Counting Utility

Count characters in text with Unicode awareness. Supports total characters, non-whitespace characters, CJK character detection, and byte-offset reporting. Essential for validating text constraints (SMS, tweets, form fields, database column limits).

Quick Start

# Count characters in a string
wc-chars-tool "Hello, 世界!"

# Count from stdin
echo "Hello World" | wc-chars-tool

# Count characters in a file
wc-chars-tool --file document.txt

Usage

wc-chars-tool [TEXT] [OPTIONS]
wc-chars-tool --file FILE [OPTIONS]

Options:
  --file FILE       Read from file instead of argument
  --bytes           Count bytes instead of characters
  --no-whitespace   Exclude whitespace from count
  --cjk-only        Count only CJK characters
  --graphemes       Count grapheme clusters (user-perceived characters)
  --json            Output as structured JSON
  --detailed        Show breakdown: total, non-ws, digits, punct, spaces

Examples

# Count total characters
wc-chars-tool "Hello World"

# Count bytes in a UTF-8 string
wc-chars-tool "Hello, 世界!" --bytes

# Count non-whitespace characters
wc-chars-tool "Hello World" --no-whitespace

# Count CJK characters only
wc-chars-tool "Hello 你好 世界 world" --cjk-only

# Detailed breakdown
wc-chars-tool "Hello, 世界! 123" --detailed --json

Features

  • Unicode-aware — correctly handles multi-byte characters (CJK, emoji, accents)
  • Grapheme clusters — counts user-perceived characters, not just code points
  • Multiple modes — total, non-whitespace, CJK, byte count
  • Detailed breakdown — digits, punctuation, spaces, letters
  • File and stdin input — flexible input sources
  • JSON output — for monitoring and script integration

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Datetime Tool

dinghaibin
全面的日期时间操作工具包,支持多种格式、时区转换、日历计算、自然语言解析以及日期...
★ 0 📥 411

Schedule Task

dinghaibin
在 Linux/Unix 系统上调度和运行周期性任务。适用于设置 cron 作业、定时备份、周期性数据同步、自动报告等场景。
★ 0 📥 405

Automation Workflow

dinghaibin
创建并管理自动化工作流,以处理重复性任务。适用于需要安排周期性数据同步、链式API调用、设置触发动作等场景。
★ 0 📥 369