Read and edit the first key in BOM-prefixed bindings.ini #5029
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5029"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RanoGames on 2026-12-01T17:46:55Z.
What it changes
A UTF-8 byte-order mark at the start of
bindings.inibecomes part of the first key name in the mouse and keyboard reader. A binding such asA = Enterthen fails to parse. The F1 key-binding editor also misses that first binding and can append a second assignment when the player edits it.Skip the leading BOM when reading binding names. Preserve it and the existing line endings when the F1 editor writes the new mapping.
How it was tested
Windows x64, commit
241e240fon5fabb46e. Both tests use synthetic bindings and require no game or GPU rendering.cargo test --locked -p victory-hle --lib reads_bindings_with_a_utf8_bompassed. This covers files starting with a binding or a comment.cargo test --locked -p victory-gpu --lib edits_first_binding_in_a_utf8_bom_filepassed. The editor reads the first key and replaces it once while preserving the BOM, CRLF and the next binding.Checked for overlap
victory-settings.txtfor the launcher and general F1 settings. #1997 also handles the general menu settings file. This change covers the separatebindings.iniruntime parser and key-binding editor. #3722 concerns reloading bindings after edits and #4968 concerns key capture on focus loss.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-12-01T17:58:21Z.
Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.
Base
5fabb46eaf6ed8771321787f8871051abde69b9b, head241e240f68b644e97252d12bb98a4f0855e97e09.git diff --numstat→ crates/victory-gpu/src/host/menu.rs 23/2, crates/victory-hle/src/modules/mnk.rs 10/0.Two new tests, both absent on the base (
git grep -F <name> 5fabb46e -- .→ no match, exit 1):edits_first_binding_in_a_utf8_bom_fileandreads_bindings_with_a_utf8_bom.Note the split: they live in two different crates, so one filter cannot find both.
git diff --check "5fabb46e..241e240f"→ no output, exit 0.Results:
running 1 test,test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1161 filtered out; finished in 0.02sand1 passed; 0 failed; 0 ignored; 0 measured; 482 filtered out; finished in 0.00s.Both write their own BOM-prefixed bindings file in a temp dir and read it back through the parser; nothing touches the title's files or a device, GPU/driver N/A. No game data.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.