Embed a manifest in totk.exe that makes UTF-8 its code page

GetModuleFileNameA, fopen, CreateFileA and getenv returned and took ANSI code page bytes while platform/win32.c,
fs_host.c and romfs.c convert paths as UTF-8, so an install folder under a Cyrillic user name lost its RomFS, profile,
RomFS patches and caches. runtime/totk.rc is compiled with the runtime objects (windres, or llvm-windres with
--toolchain), so it is also a member of libtotkrt.a. build_game.py writes build.ninja and modules.c as UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-10-24 19:35:33 +03:00
1 parent cb570e3e35
commit c50f31164d
3 files changed
+36 -9

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Embedded by totk.rc. activeCodePage makes UTF-8 the process code page (Windows 10 1903 and later): the narrow file
functions (fopen, CreateFileA, GetModuleFileNameA) and getenv then carry UTF-8, the same encoding platform/win32.c
and fs_host.c convert with, so an install folder or user profile with a non-ASCII name works. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"/>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>
+3
View File
@@ -0,0 +1,3 @@
/* The application manifest of totk.exe (totk.manifest). tools/build_game.py compiles it with the runtime objects, so it
is also a member of libtotkrt.a, which the release links with --whole-archive. */
1 24 "totk.manifest"