From 263fb111771c0932c8b0ab1cdf8b1a501ad3f19e Mon Sep 17 00:00:00 2001 From: Prohect Date: Tue, 29 Sep 2026 21:40:48 +0000 Subject: [PATCH] Fix Windows builds from non-ASCII checkout paths (#64947) ## Summary Closes #64945. Add UTF-8 header to `rc_content` which is passed to rc.exe as args. ## Testing Before this change: build failed with `thread 'main' (7344) panicked at crates\windows_resources\src\windows_resources.rs:122:10: called `Result::unwrap()` on an `Err` value: Failed("RC.EXE failed to compile specified resource file")` Alfter this change: build success. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - N/A Co-authored-by: Kunall Banerjee --- crates/windows_resources/src/windows_resources.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/windows_resources/src/windows_resources.rs b/crates/windows_resources/src/windows_resources.rs index fee3e7368bd..3cc5e5ef7ac 100644 --- a/crates/windows_resources/src/windows_resources.rs +++ b/crates/windows_resources/src/windows_resources.rs @@ -73,8 +73,14 @@ pub fn compile(manifest: bool) -> Result<(), Box> { version_parts.next().unwrap_or(0), ); + // The resource paths can contain non-ASCII characters (e.g. when the + // repository lives under a path with such characters). Rust Strings are + // encoded using UTF-8, but rc.exe decodes the .rc file using the ANSI code + // page by default, which mangles those paths and makes it fail to find the + // referenced files, so specify UTF-8 decoding. let rc_content = format!( - r#"1 ICON "{icon_escaped}" + r#"#pragma code_page(65001) +1 ICON "{icon_escaped}" {manifest_line} 1 VERSIONINFO