Skip to content

Commit b8a74fb

Browse files
committed
fix(gui): transcode non-UTF-8 text uploads to UTF-8
Strict UTF-8 probing rejected GBK/Big5/Shift-JIS/UTF-16 text files as binary and let legacy-encoded text reach the model as mojibake. Classify uploads into utf8/needs-transcode/binary (tolerating multibyte chars cut at the 32KiB probe boundary), transcode staged copies and native attachment inlining to UTF-8 via encoding_rs + chardetng, and leave in-workspace source files untouched.
1 parent 6abc0be commit b8a74fb

3 files changed

Lines changed: 386 additions & 56 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/agent-gui/src-tauri/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ portable-pty = "0.9.0"
6262
wait-timeout = "0.2.1"
6363
russh = "0.62.2"
6464
russh-sftp = "2.3.0"
65+
encoding_rs = "0.8.35"
66+
chardetng = "0.1.17"
6567

6668
[target.'cfg(target_os = "macos")'.dependencies]
6769
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSButton", "NSControl", "NSView", "NSWindow"] }

0 commit comments

Comments
 (0)