Use when user requests Chinese terminology conversion, checking, or ensuring terminology - "使用繁體中文", "使用台灣用語", "轉換成台灣用語", "確保都是台灣用語", "統一台灣用語", "改成台灣用語", "用台灣的說法", "簡體轉繁體", "繁體轉簡體", "全部改成繁體", "轉成台灣繁體", check/ensure Taiwan/Hong Kong/China terminology, simplified/traditional conversion, or phonetic transcription (Pinyin/Bopomofo)
Convert Chinese text between simplified/traditional, regional variants (China/Taiwan/Hong Kong), and phonetic forms (Pinyin/Bopomofo).
Includes scripts/fanfuaji.py - zero-dependency Python wrapper with multi-encoding support.
https://api.zhconvert.org before any --file workflow.--file)Before reading file content, apply this sequence:
Default denylist examples (block):
~/.ssh/id_rsa.env*credentials*credentials.json, service-account.json, *.pem, *.key)If user does NOT specify conversion target, MUST ask using question tool.
Available converters (priority order):
| Name | API Value | Description |
|---|---|---|
| 台灣化 | Taiwan | Traditional + Taiwan terminology |
| 繁體化 | Traditional | Traditional characters only |
| 注音化 | Bopomofo | Bopomofo (Zhuyin) phonetic |
| 中国化 | China | Simplified + China terminology |
| 香港化 | Hongkong | Traditional + Hong Kong terminology |
| 简体化 | Simplified | Simplified characters only |
| 拼音化 | Pinyin | Pinyin romanization |
| 火星化 | Mars | Internet slang variant |
| 維基繁體化 | WikiTraditional | Wikipedia Traditional |
| 维基简体化 | WikiSimplified | Wikipedia Simplified |
Ambiguity examples:
TaiwanRecommendation: Use absolute paths for input/output files to avoid directory context issues.
If user does NOT specify output destination, ask using question tool:
When input is from file (--file input.txt):
How would you like to receive the result?
- Display in chat (stdout)
- Overwrite original file (input.txt)
- Save to new file (specify filename)
When input is text (no --file):
How would you like to receive the result?
- Display in chat (stdout)
- Save to file (specify filename)
Rule: When output will write to a file AND file exists, MUST ask using question tool.
File will be written when:
| Command Pattern | Target File | Check Needed? |
|---|---|---|
"text" --output file.txt | file.txt | ✅ If exists |
--file input.txt (no --output) | input.txt (overwrite) | ✅ Always |
--file input.txt --output out.txt | out.txt | ✅ If exists |
"text" (stdout) | - | ❌ No |
Question template:
File "filename" already exists. What would you like to do?
- Overwrite existing file
- Save to new file (filename_YYYY-MM-DD.txt)
- Cancel operation
# Text conversion
python scripts/fanfuaji.py "软件开发" --converter Taiwan
# → 軟體開發
# File conversion
python scripts/fanfuaji.py --file input.txt --converter Taiwan --output output.txt
# Different encodings (Big5, GBK, GB2312, Shift_JIS)
python scripts/fanfuaji.py --file big5_file.txt --encoding big5 --converter Taiwan
# Term protection
python scripts/fanfuaji.py "软件" --converter Taiwan --protect "软件"
# Post-conversion replacement
python scripts/fanfuaji.py "哦" --converter Taiwan --post-replace "哦=喔,啰=囉"
import sys
sys.path.insert(0, 'scripts')
from fanfuaji import convert_text, Converter
result = convert_text("软件开发", Converter.TAIWAN)
print(result) # 軟體開發
Default: UTF-8
Supported: big5, gbk, gb2312, and all Python codecs
Output: Always UTF-8
# Auto-detect and handle legacy encodings
python scripts/fanfuaji.py --file legacy.txt --encoding big5 --converter Taiwan
api.zhconvert.org before file workflows