Cn Text Encoding Detector
/install cn-text-encoding-detector
Text Encoding Detector
Automatically detect the character encoding of text files.
Features
- Support common Chinese encodings (UTF-8, GBK, GB2312)
- Detect BOM (Byte Order Mark) markers
- Report file size along with encoding
- Pure Python, no external dependencies
Supported Encodings
- UTF-8 (with or without BOM)
- UTF-16 LE/BE
- GBK / GB2312
- Latin-1 / ISO-8859-1
- Unknown (when detection fails)
Usage
python3 scripts/encoding_detector.py --file document.txt
Example Output
{
"file": "document.txt",
"encoding": "UTF-8",
"size_bytes": 15234
}
Use Cases
- Fix garbled text files
- Batch convert files between encodings
- Verify file encoding before processing
Notes
Detection tries UTF-8 first, then GBK. If both fail, returns "UNKNOWN".
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install cn-text-encoding-detector - After installation, invoke the skill by name or use
/cn-text-encoding-detector - Provide required inputs per the skill's parameter spec and get structured output
What is Cn Text Encoding Detector?
Detect text file encoding (UTF-8, GBK, Latin-1, etc). Auto-detect BOM markers. Pure Python standard library, no API key required. It is an AI Agent Skill for Claude Code / OpenClaw, with 31 downloads so far.
How do I install Cn Text Encoding Detector?
Run "/install cn-text-encoding-detector" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Cn Text Encoding Detector free?
Yes, Cn Text Encoding Detector is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Cn Text Encoding Detector support?
Cn Text Encoding Detector is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Cn Text Encoding Detector?
It is built and maintained by freedompixels (@freedompixels); the current version is v1.0.0.