runtime: encode the persistent storage root as UTF-8 #1551
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1551
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1551/head"
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?
@SuperCraft3M on GitHub · 2026-11-24 13:51 UTC · original
SuperCraft3M:runtime/storage-root-utf8→main· +63 −7 · 5 files · 2 commits · merged 2026-11-24 14:36 UTCChange
The runtime proxy currently reads
X2W_STORAGE_PATHwithGetEnvironmentVariableA. On a desktop using a legacy ANSI code page, non-ASCII names are returned in that code page and become damaged when the caller consumes the path as UTF-8. Read the environment in UTF-16 and explicitly encode UTF-8 before appending the separator. The existing bounded buffer and logged fallback remain in use; invalid UTF-16 and UTF-8 expansion beyond capacity are refused without partial output.This follows the public console encoding contract: https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/overviews/utf-8 . The change is limited to the persistent-storage path answer in the startup runtime proxy, with no dependency on #1549.
Verification
Base:
3c6273ac. Windows 11, MSVC 19.44 Debug.cmake --build C:/Xbox2Windows-build --target startup_storage_root_check startup_stub_gameinput --parallel 4: passed.ctest --test-dir C:/Xbox2Windows-build --no-tests=error -R '^startup_storage_root' --output-on-failure: passed 2/2, no skips. The source-built fixture adds 7 UTF-8 cases (ASCII, accent/CJK/supplementary character, empty/null, invalid surrogate, maximum fitting expansion and over-capacity expansion). The existing separator mutation remains an expected failure.git diff --check: passed.A local offline diagnostic replay independently changed three storage-directory opens from failure to success with the same non-ASCII root. It still reached a later null-pointer write; this does not establish complete startup or gameplay. Raw traces and local inputs remain private.
Evidence and follow-up
Original source-built tests under MIT; no game files, binaries or raw captures included. The conversion fixture verifies exact UTF-8 bytes and output bounds; it does not model the later crash. Reproduction and byte limits are updated in
docs/experiments.mdanddocs/startup-runtime.md.AI-assisted (Codex).
@R0Y00 on GitHub · 2026-11-24 14:30 UTC · original
Resolved the startup-runtime documentation conflict in
b7b17d1f. The offline store-context row from main and the UTF-8 storage path limit are both preserved. Windows Release built startup_stub_gameinput and startup_storage_root_check. Both storage-root tests passed, including the separator control, and the docs check passed 345 links.