Skip to content

v3.0.1

Choose a tag to compare

@hoolulu hoolulu released this 08 Jun 14:26
· 130 commits to main since this release

v3.0.1 — Windows CP936 Encoding Compatibility + BOM Tolerance

🐛 Bug fix: Windows non-English language encoding crash (核心修复)

Root cause: Windows PowerShell 5.1 console encoding CP936(GBK) cannot represent 18 non-English languages (Cyrillic, CJK, Arabic, Thai, etc.), causing:

  • detect_lang.py receiving non-ASCII topics via argv gets garbled
  • PowerShell Set-Content -Encoding UTF8 adds BOM → Python json.load() crashes
  • Shell redirect/pipe encodes via CP936, corrupting non-ASCII text

修复方案(三层防御):

Layer Fix File
输入端 Input detect_lang.py new --file/--output args, bypass shell argv entirely tools/detect_lang.py
读容错 Read All Python file reads use encoding='utf-8-sig' (BOM auto-stripped) tools/dr_tools.py dr_check.py dr_gen.py
输出端 Output sys.stdout.reconfigure(encoding='utf-8') for UTF-8 stdout tools/detect_lang.py

📝 Documentation (文档)

  • SKILL.md Step 0 updated to cross-platform --file + --output workflow
  • New section 9: Cross-platform Encoding Standards (5 hard rules)
  • SKILL.md 第 9 节新增「跨平台编码规范」5 条硬性规则

✅ Verified (验证)

10 languages end-to-end: zh/ja/ko/ru/ar/th/de/es/en/uk — all pass

All pass: True

Full changelog: git log v3.0.0..v3.0.1