Files
Neo-ZQYY/scripts/ops/_fix_playbook_3b.py
2026-03-15 10:15:02 +08:00

24 lines
830 B
Python

path = 'c:/NeoZQYY/docs/h5_ui/compare/AGENT-PLAYBOOK.md'
with open(path, 'rb') as f:
raw = f.read()
content = raw.decode('utf-8')
# Fix all remaining instances of wrong characters
content = content.replace('\u9501\u70b9\u6cd5', '\u9501\u70b9\u6cd5'.replace('\u9501', '\u9576')) # won't work this way
# Direct string replacements
content = content.replace('\u5207\u6362\u5230\u9501\u70b9\u6cd5', '\u5207\u6362\u5230\u9501\u70b9\u6cd5')
# Just replace all occurrences of the wrong chars
import re
# \u9501 = 锁, \u9576 = 锚
content = content.replace('\u9501\u70b9', '\u9576\u70b9')
with open(path, 'wb') as f:
f.write(content.encode('utf-8'))
# Verify
count = content.count('\u9576\u70b9') # 锚点
remaining = content.count('\u9501\u70b9') # 锁点
print('锚点 count:', count, '| 锁点 remaining:', remaining)