[Bug] Panic: Invalid char boundary in string slicing with multibyte characters
Bug Description
⏺ 找到 bug 了!
根因:
- 测试数据在地址中间插入全角空格:x[:6] + " " + x[6:](上海 市...)
- 清洗逻辑把全角空格转成半角,但只合并连续空格,不移除单个空格
- 地址类型应该完全移除中间空格
需要修复:
- 添加 address 类型识别
- 地址清洗时移除所有空格
⏺ Update(行动/产品/Excel清洗器/smart_cleaner.go)
✳ 添加 address 类型… (esc to interrupt · 1m 9s · ↓ 1.7k tokens)
⎿ ☐ 添加 address 类型识别
☐ 添加 address 清洗逻辑
☐ 检查其他类型是否有类似问题
☐ 重新测试
──────────────────────────────────────────────────────────────────────────
❯
──────────────────────────────────────────────────────────────────────────
⏵⏵ accept edits on (shift+tab Update available! Run: brew upgrade
to cycle) claude-code
thread '<unnamed>' (9622185) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 5 is not a char boundary; it is inside '格' (bytes 3..6) of 空格
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
zsh: abort claude -r
liujiahao@192 interview %
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.2
- Feedback ID: f50b3035-275c-43d8-90e4-46139b65ca9f
Errors
[]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗