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 <hey@kimchiii.space>
This commit is contained in:
Prohect 2026-09-29 21:40:48 +00:00 • committed by GitHub
parent 0f9c923e67
commit 263fb11177
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,8 +73,14 @@ pub fn compile(manifest: bool) -> Result<(), Box<dyn std::error::Error>> {
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