UTF-8 byte index boundary error with Korean characters
Resolved 💬 3 comments Opened Jan 1, 2026 by lhs0609a-cpu Closed Jan 5, 2026
Description
When processing Korean text, a Rust panic occurs due to UTF-8 byte index boundary issues.
Error Message
byte index 11 is not a char boundary; it is inside '딩' (bytes 9..12) of `트레이딩`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Context
- The Korean word
트레이딩(meaning "trading") causes the error - Korean characters are 3 bytes each in UTF-8
- The error occurs when slicing at byte index 11, which falls in the middle of the character '딩' (bytes 9-12)
Expected Behavior
String operations should use character boundaries rather than raw byte indices when handling multi-byte UTF-8 characters.
Environment
- Platform: Windows (win32)
- Claude Code version: Latest
Suggested Fix
Use Rust's char_indices() or similar character-aware methods instead of byte indexing for string slicing operations.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗