Windows test package: print the shortcut target in UTF-8 (false error and unmasked user name in wintest-4) #39

Manually merged
SkyfaR merged 1 commit from windows-wintest-utf8 into main 2026-10-06 17:18:50 +02:00
Owner

A fix to the Windows test package, found in the real-PC run wintest-4 (ogc-messungen issue #7).

packaging/windows/test/lnk-aumid.c printed the shortcut's target with wprintf, so the target came out in the console's code page. run-tests.ps1 reads programs' output as UTF-8, so a profile folder with an accented user name came out garbled ("C:\Users\Ren� …"). Two things followed:

  • The comparison with the expected target failed, which was a false error: the shortcut was right.
  • The masking of the profile folder as %USERPROFILE% did not match, so the tester's user name stood in the report.

The helper now converts its two lines with WideCharToMultiByte(CP_UTF8) and writes them with WriteFile. notification-state.c already writes UTF-8.

Tests: in the container, packaging/windows/test/wine-test.sh (which reads shortcuts with the helper) and dist.sh with the app bundle pass. Wine's own profile has no accented name, so the accented case itself is checked only by the next real-PC run.

Everything else in wintest-4 worked on the real Windows 11 PC; see the issue.

A fix to the Windows test package, found in the real-PC run wintest-4 (ogc-messungen issue #7). `packaging/windows/test/lnk-aumid.c` printed the shortcut's target with `wprintf`, so the target came out in the console's code page. `run-tests.ps1` reads programs' output as UTF-8, so a profile folder with an accented user name came out garbled ("C:\Users\Ren� …"). Two things followed: - The comparison with the expected target failed, which was a false error: the shortcut was right. - The masking of the profile folder as `%USERPROFILE%` did not match, so the tester's user name stood in the report. The helper now converts its two lines with `WideCharToMultiByte(CP_UTF8)` and writes them with `WriteFile`. `notification-state.c` already writes UTF-8. **Tests:** in the container, `packaging/windows/test/wine-test.sh` (which reads shortcuts with the helper) and `dist.sh` with the app bundle pass. Wine's own profile has no accented name, so the accented case itself is checked only by the next real-PC run. Everything else in wintest-4 worked on the real Windows 11 PC; see the issue.
Print the shortcut's target in UTF-8 in the Windows test helper
All checks were successful
CI / Windows, MSYS2 sysroot (pull_request) Successful in 22s
CI / Windows, command line (clippy with tests) (pull_request) Successful in 46s
CI / Windows, command line (tests under Wine) (pull_request) Successful in 1m54s
CI / Windows, desktop app (clippy, script tests) (pull_request) Successful in 1m39s
CI / Windows, GTK with AccessKit (pull_request) Successful in 46s
CI / Windows, installer (tests under Wine) (pull_request) Successful in 2m30s
CI / Windows, desktop app (tests under Wine) (pull_request) Successful in 2m12s
CI / Format, lint and test (pull_request) Successful in 5m52s
CI / Bundle programs, command line and helper (pull_request) Successful in 2m32s
CI / Arch package (pull_request) Successful in 3m21s
CI / Bundle for any distribution (pull_request) Successful in 40s
CI / Bundle programs, desktop app (pull_request) Successful in 3m26s
CI / Windows, installer and portable zip (pull_request) Successful in 7m18s
CI / Release (pull_request) Has been skipped
55f8c6119c
On the real PC, lnk-aumid.exe wrote a profile folder with an accented
user name in the console's code page, which run-tests.ps1 read as
UTF-8. The garbled path neither matched the expected one, a false
error, nor was masked as %USERPROFILE%, so the tester's user name stood
in the report. The helper now writes its lines as UTF-8 itself.
SkyfaR manually merged commit f13b6da6e2 into main 2026-10-06 17:18:50 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LevelXStudios/OpenGameCompressor!39
No description provided.