[BUG] Panic on UTF-8 multibyte character boundary in Korean text
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
Claude Code crashes with a Rust panic when processing Korean (UTF-8 multibyte) characters in file paths or content. The error occurs during string slicing operations that don't respect UTF-8 character boundaries.
### Error Message
thread '' (202352) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 15 is not a char boundary; it is inside '다' (bytes 13..16) of 총괄합니다.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
### Environment
- Claude Code version: 2.1.3
- OS: macOS 15.1.1
- Platform: macOS x64
- Runtime: Bun v1.3.5
### Steps to Reproduce
- Work in a directory with Korean characters in the path (e.g.,
/내 드라이브/) - Edit files containing Korean text
- Crash occurs intermittently during edit operations
### Expected Behavior
Claude Code should properly handle UTF-8 multibyte characters (Korean, Chinese, Japanese, etc.) without panicking.
### Actual Behavior
The application panics when attempting to slice a string at an invalid byte index that falls in the middle of a multibyte UTF-8 character.
### Root Cause (suspected)
String slicing in Rust using byte indices without checking is_char_boundary(). The Korean character '다' occupies bytes 13-16, but the code attempts to access byte index 15.
### Impact
- Cannot reliably work with non-ASCII file paths
- Frequent crashes interrupt workflow
- No workaround available for users who must use Korean paths/content
### Suggested Fix
Use char_indices() or check is_char_boundary() before slicing strings, or use .chars() iterator for character-based operations.
What Should Happen?
Description
Claude Code crashes with a Rust panic when processing Korean (UTF-8 multibyte) characters in file paths or content. The error occurs during string slicing operations that don't respect UTF-8 character boundaries.
### Error Message
thread '' (202352) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 15 is not a char boundary; it is inside '다' (bytes 13..16) of 총괄합니다.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
### Environment
- Claude Code version: 2.1.3
- OS: macOS 15.1.1
- Platform: macOS x64
- Runtime: Bun v1.3.5
### Steps to Reproduce
- Work in a directory with Korean characters in the path (e.g.,
/내 드라이브/) - Edit files containing Korean text
- Crash occurs intermittently during edit operations
### Expected Behavior
Claude Code should properly handle UTF-8 multibyte characters (Korean, Chinese, Japanese, etc.) without panicking.
### Actual Behavior
The application panics when attempting to slice a string at an invalid byte index that falls in the middle of a multibyte UTF-8 character.
### Root Cause (suspected)
String slicing in Rust using byte indices without checking is_char_boundary(). The Korean character '다' occupies bytes 13-16, but the code attempts to access byte index 15.
### Impact
- Cannot reliably work with non-ASCII file paths
- Frequent crashes interrupt workflow
- No workaround available for users who must use Korean paths/content
### Suggested Fix
Use char_indices() or check is_char_boundary() before slicing strings, or use .chars() iterator for character-based operations.
Error Messages/Logs
thread '<unnamed>' (202352) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 15 is not a char boundary; it is inside '다' (bytes 13..16) of ` 총괄합니다.`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
============================================================
Bun v1.3.5 (1e86cebd) macOS x64
macOS v15.1.1
CPU: sse42 popcnt avx avx2
Args: "claude" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(467) jsc spawn(96) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2" "node:diagnostics_channel"
Elapsed: 272593ms | User: 84823ms | Sys: 31064ms
RSS: 0.60GB | Peak: 0.60GB | Commit: 0.72GB | Faults: 201 | Machine: 0.07TB
panic(main thread): Segmentation fault at address 0x0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.5/m_11e86cebmgEugogC____________+y68qB_______A2AA
Steps to Reproduce
thread '<unnamed>' (202352) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 15 is not a char boundary; it is inside '다' (bytes 13..16) of 총괄합니다.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
============================================================
Bun v1.3.5 (1e86cebd) macOS x64
macOS v15.1.1
CPU: sse42 popcnt avx avx2
Args: "claude" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(467) jsc spawn(96) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2" "node:diagnostics_channel"
Elapsed: 272593ms | User: 84823ms | Sys: 31064ms
RSS: 0.60GB | Peak: 0.60GB | Commit: 0.72GB | Faults: 201 | Machine: 0.07TB
panic(main thread): Segmentation fault at address 0x0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.5/m_11e86cebmgEugogC____________+y68qB_______A2AA
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗