anthropics / anthropics/skills

[Bug] skill-creator crashes with UTF-8 boundary panic when processing Chinese text

未关闭
#263 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
176k
派生
20.8k
平均合并
7 小时 21 分钟
30 天内合并 PR
5

描述

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:

1. Run Claude Code CLI (claude)
2. Invoke the skill-creator skill (e.g., /skill-creator)
3. Provide input containing Chinese characters (中文) during the skill creation process
4. 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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。