-
Notifications
You must be signed in to change notification settings - Fork 12.6k
[Bug] skill-creator crashes with UTF-8 boundary panic when processing Chinese text #263
Description
Bug Report: Panic on UTF-8 character boundary when using skill-creator with Chinese text
Version: Claude Code 2.0.76
OS: macOS (Darwin 25.2.0)
Description:
Claude Code crashes with a Rust panic when using the skill-creator skill with Chinese text input.
Error Message:
thread '' (1992924) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 2 is not a char boundary; it is inside '。' (bytes 0..3) 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
Steps to Reproduce:
- Run Claude Code CLI (claude)
- Invoke the skill-creator skill (e.g., /skill-creator)
- Provide input containing Chinese characters (中文) during the skill creation process
- The application crashes with the above panic message
Analysis:
The error indicates an invalid UTF-8 string slicing operation. The Chinese full-stop character 。 (U+3002) is a 3-byte UTF-8 character (bytes 0-2), but the code attempts to slice at byte index 2, which is in the middle of this character. This violates Rust's string safety guarantees and causes a panic.
This likely occurs during string truncation, display formatting, or text processing within the skill-creator workflow.
Expected Behavior:
Claude Code should correctly handle multi-byte UTF-8 characters (including CJK characters and punctuation) when creating skills with non-ASCII content.
Suggested Fix:
Use character-aware string operations (e.g., char_indices(), chars().take(n)) instead of byte-based indexing when processing user input or model output containing non-ASCII characters.