Panic on Korean characters - byte index not at char boundary

Resolved 💬 3 comments Opened Jan 5, 2026 by rickeypark-nsuslab Closed Jan 8, 2026

Description

Claude Code crashes with a Rust panic when processing Korean text that appears to be in the status line or todo display.

Error Message

thread '<unnamed>' panicked at 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
[1]    5186 abort      claude

Environment

  • OS: macOS (Darwin 25.2.0)
  • Architecture: Apple Silicon

Steps to Reproduce

  1. Use Korean text in todo items or status displays
  2. Text containing Korean characters followed by | triggers the crash
  3. Example text that crashed: 설계 |

Root Cause Analysis

String slicing uses byte index instead of character boundary. Korean characters (Hangul) are 3 bytes in UTF-8:

  • '설' = bytes 0..3
  • '계' = bytes 3..6
  • Attempting to slice at byte index 5 fails because it's inside '계'

Expected Behavior

Should handle multi-byte UTF-8 characters correctly by using character boundaries instead of raw byte indices.

Suggested Fix

Use char_indices() or similar UTF-8 aware string methods instead of direct byte indexing.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗